Thursday, October 11th, 2007
Suppose you are using Subversion to manage your code and find that you’d like to include revision information within a file. You might read this and think it won’t work, but do not be dismayed. You really wanted to look at Keyword Substitution in the Subversion book.
There you will find that enabling substution on a file is rather easy. Say you have some code in Spam.py and you’re running TortiseSVN. Then, the basic process is:
- Rt click file -> Properties -> Subversion tab -> Properties.
- Add a property
svn:keywordswith valueDate Revision Author HeadURL Id - Put a keyword in the file where you want it to expand the thing — I put
$Id$in the docstring of Spam.py. Id is a summary which, after checking in, expanded to"$Id: Spam.py 513 2007-10-10 23:10:30Z username $".
