O'Reilly logo

Linux Server Hacks by Rob Flickenger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #29. CVS: Using Tags

Tagging a Module revision in CVS

Tags assign a symbolic name to a revision of a file or a set of files. cvs tag tags the repository versions of all the files in the current working directory and its subdirectories.

The cvs tag command is based on a timestamp. It assigns the symbolic name to the version of the file or directory that is closest to and older than the timestamp; it does not look at the working directory.

Note that CVS doesn't allow the `.' character in tags. Specify the filename after the tag name, as in the following example:

cvs tag tagname filename
cvs tag tagname

Otherwise, the command tags the repository versions of all files in the current working directory:

cvs tag -c tagname

Use the -c option to cause the process to abort if the repository copy differs from the working copy:

cvs/example$ cvs tag release-1-0 src/sample.c
cvs/example/src$ cvs tag release-1-0 
cvs/example/src$ cvs tag -c release-1-0

To retrieve a tagged version, use the -r flag to checkout or update. If you checkout or update in your usual working directory, the tagged version will overwrite the existing files, as in:

cvs checkout -r tagname
cvs update -r tagname

Here's an example:

cvs$ mkdir example-rel-1.0
cvs/example-rel-1.0$ cvs checkout -r release-1-0

or

cvs/example$ cvs update -r release-1-0

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required