I would like to start tagging my deployed binaries with the latest SVN revision number.
However, because SVN is file-based and not directory/project-based, I need to
For me the best way to find out the last revision number of the trunk/branch is to get it from the remote URL. It is important NOT to use the working dir because it may be obsolete. Here is a snippet with batch ( I hate a much ;-)):
@for /f "tokens=4" %%f in ('svn info %SVNURL% ^|find "Last Changed Rev:"') do set lastPathRev=%%f
echo trunk rev no: %lastPathRev%
Nevertheless I have a problem to hardcode this number as interim version into sources containing $Rev:$. The problem is that $Rev:$ contains the file rev. no. So if trunk rev no is larger then the rev no of version file, I need to modify this file "artificially" and to commit it to get the correct interim version (=trunk version). This is a pane! Does somebody has better idea? Many thanks