184Chapter6 • Introduction to CVS
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
As you can see, there are two files here that are out of sync with the repository. The first
one is
fuzion.pl
that has been modified, but not checked back in; and the other is
test.dat
, which someone else has modified and returned to the repository.
At this point, you can use
diff
to determine the extent of the changes and determine the
appropriate course of action.
If your local copy of a file has changed, and the version in the repository has changed from
the last time that you checked it out, you will receive a message indicating that the files needed
to be merged.
File: test.dat Status: Needs Merge
Working revision: 1.2
Repository revision: 1.3 /usr/local/cvsroot/fuzion/
test.dat,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
Again, you will want to determine the extent of the changes to the files and merge the two
so that no changes will be lost when the file is checked back into the repository. Should you
attempt to commit a change on a file when a newer version of the file exists on the server, CVS
will complain and refuse to update the file.
cvs server: Up-to-date check failed for `test.dat'
cvs [server aborted]: correct above errors first!
cvs commit: saving log message in /tmp/cvsa15396
In the event of conflicts, you can use the
diff
option to examine the differences in the
file and the
update
option to merge them. Both of these options are covered below.
6.4.5Finding Differences
CVS can be used to determine the difference between a file in the repository and a file in
the working directory. This is accomplished by using the
diff
option.
# cvs diff fuzion.pl
Index: fuzion.pl
============================================================
RCS file: /usr/local/cvsroot/fuzion/fuzion.pl,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 fuzion.pl
134c134
< print "=" x 40 ;
---
> print "=" x 80 ;