Chapter 13. Keyword substitution

Table of Contents

Keyword List
Using keywords
Avoiding substitution
Substitution modes
$Log$

As long as you edit source files inside a working directory you can always find out the state of your files via cvs status and cvs log. But as soon as you export the files from your development environment it becomes harder to identify which revisions they are.

cvsnt can use a mechanism known as keyword substitution (or keyword expansion) to help identifying the files. Embedded strings of the form $keyword$ and $keyword:...$ in a file are replaced with strings of the form $keyword:value$ whenever you obtain a new revision of the file.

Keyword List

This is a list of the keywords. This list may be altered or augmented by the use of the keywords control file (seethe section called “keywords”).

$Author$

The login name of the user who checked in the revision.

$Branch$

The name of the branch that the revision is a member of.

$CommitId$

The Commit (or Session) identifier of the commit that generated this revision.

$Date$

The date and time (UTC) the revision was checked in.

$Header$

A standard header containing the full pathname of the rcs file, the revision number, the date (UTC), the author, the state, and the locker (if locked). Files will normally never be locked when you use cvsnt.

$RCSHeader$

A standard header containing the relative pathname of the rcs file, the revision number, the date (UTC), the author, the state, and the locker (if locked). Files will normally never be locked when you use cvsnt.

$Id$

Same as $Header$, except that the rcs filename is without a path.

$Name$

Tag name used to check out this file. The keyword is expanded only if one checks out with an explicit tag name. For example, when running the command cvs co -r first, the keyword expands to Name: first.

$Locker:$

The login name of the user who locked the revision (empty if not locked, which is the normal case unless cvs admin -l is in use). This keyword has little meaning under cvsnt.

$Log$

The log message supplied during commit, preceded by a header containing the rcs filename, the revision number, the author, and the date (UTC). Existing log messages are not replaced. Instead, the new log message is inserted after $Log$. Each new line is prefixed with the same string which precedes the $Log keyword. For example, if the file contains

  /* Here is what people have been up to:
   *
   * $Log: foo.txt,v $
   * Revision 1.1  1997/01/03 14:23:51  joe
   * Add the superfrobnicate option
   *
   */

then additional lines which are added when expanding the $Log keyword will be preceded by * . Unlike previous versions of cvsnt and rcs, the comment leader from the rcs file is not used. The $Log keyword is useful for accumulating a complete change log in a source file, but for several reasons it can be problematic. the section called “$Log$”.

$rcsfile$

The name of the rcs file without a path.

$Revision$

The revision number assigned to the revision.

$Source$

The full pathname of the rcs file.

$State$

The state assigned to the revision. States can be assigned with cvs admin -s--see the section called “admin options”.