To view the history of a particular file, use the ``cvs log'' command, which will give you a brief description of the file, the log entries from each time changes to the file were committed, and other bits of info:
mbland@defender /home/student/mbland/projects/class_proj -> cvs log frob.c RCS file: /home/student/mbland/cvsroot/cpsc426/class_proj/frob.c,v Working file: frob.c head: 1.3 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 3; selected revisions: 3 description: ---------------------------- revision 1.3 date: 2000/07/12 21:43:23; author: mbland; state: Exp; lines: +2 -2 Improved robustness of magic_grue_detect() ---------------------------- revision 1.2 date: 2000/07/12 21:40:37; author: mbland; state: Exp; lines: +10 -1 Added magic grue detection function ---------------------------- revision 1.1 date: 2000/07/12 21:36:33; author: mbland; state: Exp; "Added a grue warning message" =============================================================================
You can also execute the cvs log command from any given directory in the module in order to see the logs of every file in that directory. Unlike the cvs add function, cvs log will recursively descend subdirectories.
You might also notice that CVS refers to the copy of the file in the repository as an ``RCS'' file. This is because CVS is based on an earlier source code management system called RCS, and retains the RCS file format for its repository files.
If you would like to see the specific differences between two revisions of a file, you can use the ``cvs diff'' command, specifying which revisions to compare after each ``-r'' argument:
mbland@defender
/home/student/mbland/projects/class_proj -> cvs diff -c -r 1.2 -r 1.3 frob.c
Index: frob.c
===================================================================
RCS file: /home/student/mbland/cvsroot/cpsc426/class_proj/frob.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** frob.c 2000/07/12 21:40:37 1.2
--- frob.c 2000/07/12 21:43:23 1.3
***************
*** 7,15 ****
printf("It is pitch black. You are likely to be eaten by a grue.\n");
}
! int magic_grue_detect(char *sound)
{
! if (strcmp("gurgling", sound) == 0) {
magic_grue_warning();
return GRUE_LURKING;
} else
--- 7,15 ----
printf("It is pitch black. You are likely to be eaten by a grue.\n");
}
! int magic_grue_detect(char *sound, int lumens)
{
! if ((strcmp("gurgling", sound) == 0) || (lumens == 0)) {
magic_grue_warning();
return GRUE_LURKING;
} else
The ``-c'' argument specifies that the differences are to be shown within three lines of context; leave this option off if you want only the exact lines which have changed.