Section 5.5. Displaying Recent Changes


5.5. Displaying Recent Changes

The cvs annotate command displays the most recent change for each line of a file in the repository. This command is very helpful when you need to know which change broke the compilation or who rewrote a key paragraph in the documentation incorrectly. This command works off the repository copy, not the sandbox copy, so it does not show any changes in the sandbox that were not committed.

For each line, cvs annotate shows the revision number for the last change, the user, the date, and the contents of the line. This is a quick way of discovering who made which change. Example 5-17 shows some of the annotations for the wizzard.h file.

Example 5-17. Using cvs annotate

 bash-2.05a$ cvs annotate src/wizzard.h Annotations for src/wizzard.h *************** 1.6     (doppel   15-Apr-06): #include "config.h"   /* using autoconf */ 1.6     (doppel   15-Apr-06): #include "options.h"  /* manual options that can't 1.1     (jenn     11-Apr-06): 1.2     (jenn     13-Apr-06): #define TRUE 1 1.2     (jenn     13-Apr-06): #define FALSE 0 

cvs annotate has the following syntax:

 cvs [cvs-options] annotate [command-options] [filenames] 

If you don't provide a filename, cvs annotate attempts to run annotate on all the files in the current sandbox. The filenames can be directories or modules.

annotate doesn't work correctly on binary files. CVS tries to display them as text files, which can trigger the bell character and mess with your terminal window.


Use the -F option to run cvs annotate on binary files. You can select which revision to display with -D date and -r revision (or tag), and you can use the -f option to force CVS to use the most recent revision on the trunk if no revision matches the specified date, revision, or tag. cvs annotate uses the usual -l and -R options to control local and recursive operation, respectively.

Graphic clients also use pretty colors for annotate. Figure 5-4 shows the annotate display in TkCVS.

Figure 5-4. Graphic display of annotate





Essential CVS
Essential CVS (Essentials)
ISBN: 0596527039
EAN: 2147483647
Year: 2006
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net