Java Reference
In-Depth Information
Example 8.1
Sample output from
cvs diff
$ cvs diff Account.java
albing@cvs.multitool.net's password:
Index: Account.java
===================================================================
RCS file: /usr/lib/cvs/cvsroot/JavaAppDevLinux/majorApp/net/multitool/core/
Account.java,v
retrieving revision 1.10
diff -r1.10 Account.java
31d30
< this.parent = null;
66a66
> * returns an iterator
93c92
< children.put(acct, name);
---
> children.put(name, acct);
$
In Example 8.1, CVS has found three differences—one line being re-
moved, one line being added, and one line being changed. The
<
precedes lines
from the repository version, and the
>
precedes lines from the new, that is,
changed, version. The
31d30
shows the line numbers from both versions, sep-
arated by a single character to indicate what difference action is being described:
a
for adding lines,
d
for deleting lines, and
c
for lines that change.
A typical work sequence might go something like this:
1. Edit some files.
2.
cvs diff
those files.
3.
cvs commit
those files.
4. Go to 1.
The
cvs diff
command is also quite useful for finding out what changed
between some previous version of a file and the current version:
$ cvs diff -r 1.15 Account.java
or between two different previous versions:
$ cvs diff -r 1.12 -r 1.15 Account.java