When Update Finds a Conflict
[Previous] [Main] [Next]

When Update Finds a Conflict


CVS works by allowing multiple people to work on the same file. When you run the update command any changes made since you started work on a file are "merged" into your file. If you have not changed the same lines there is usually no problem. If you have changed the same lines then there is a conflict between your changes and someone else's.

·CVS takes your original file and names is .#filename_revision_number  
·CVS marks up your code so that you can see the conflicts  
You will see
RCS file: /usr/local/cvsrepos/test.java,v
cvs retrieving version 1.4
cvs retrieving version 1.5
cvs merging differences between version 1.4 and version 1.5
rcsmerge: warning conflict during merge
cvs server: conflicts found is test.java
C test.java

Here is what part of the file might look like
System.our.println("line 100");
System.our.println("line 101");
<<<<<<<<< Test.java
System.our.println("line 102");
System.our.println("line 103");
System.our.println("These lines came from the server. Someone else entered them");
================
System.our.println("line 102");
System.our.println("line 103");
System.our.println("line 104");
System.our.println("These lines you added since you checked the file out.");
>>>>>>>>>>>>>>>> 1.5
System.our.println("line 200");
System.our.println("line 201");