On Dec 4, 2013, at 06:00, Cooke, Mark wrote: > I would like to include the svn revision number in my project's version info > but I am confused by the results of svnversion. I want the version number of > a tagged tree to always be the same (i.e. the last commit to the tag) but if > the tag is to be rebuilt using a fresh checkout some time later `svnversion` > seems to report the HEAD revision. So I looked at `svnversion -c` but this > always seems to give me a range e.g. `2:1476`, even directly after an update. > > I have read the red book but it is quite vague about the -c option. Why is > `-c` always giving me a range?
I think the `-c` option means: given all the item in this directory and recursive subdirectories, give the oldest and newest changed file. So, the oldest item in your working copy was last changed in revision 2, and the newest was last changed in revision 1476. And `svnversion` without any flag does seem to give the latest revision to which the working copy was updated, not the last changed revision. If you want the last changed revision, you could use: svn info | sed -n 's/^Last Changed Rev: //p'