The journal of Paul M. Watson.

Monday, September 26, 2005

Subversion keywords

A handy feature of Subversion (which I am told other SCMs share) is that of keyword substitution. You can put a keyword in your code, e.g. $Date, which on commit is replaced with the relevant value.

The use of this is mainly to update code comments. Many coders put a block comment at the top of their class files which show the author, last updated dates and other info. Not every coder remembers to update this comment block when they make quick changes. Having it as a keyword leaves it up to Subversion to change.

The Version Control with Subversion online book lists the other available keywords.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home