Subversion oddity - svn info revision higher than last changed rev on project folder

Wim Hollebrandse picture Wim Hollebrandse · Dec 7, 2009 · Viewed 10k times · Source

Got something going on I can't explain.

I have a working copy of my project - done svn update (which says: Updated to revision 1895), I know it's the latest. When I perform an svn info on the project folder, the Revision is 1895, but the Last Changed Rev is 1888.

Inspecting the log using TortoiseSVN shows 1888 as the last revision, no trace of 1895. An svn log on 1895 is empty, and an svn diff between 1895 and 1888 is empty as well, ie. no differences.

How did I somehow end up with some rogue revision that hasn't really changed anything? It basically is causing the build server (thinks it's on 1888) to be out of sync with my MSBuild SvnVersion task (thinks revision is 1895).

Any suggestions appreciated.

Edit: If Revision will always show the latest revision for the whole repository, it means that things like SvnVersion MSBuild task (which uses svnversion.exe, but exhibits similar behaviour) don't display the correct revision for when you have a multiple project single repository, you will need to use "Last Changed Rev" for your version number.

As a result, now rolling my own SvnLastChangedRev MSBuild task.

Answer

Michael Aaron Safyan picture Michael Aaron Safyan · Dec 7, 2009

This is not a problem or an oddity... the revision number applies to the entire Subversion repository, and therefore, the revision number may be higher due to changes elsewhere in the repository than the last revision number at which something changed in the branch of the repository in which you are working.

To clarify, if you commit to trunk, bringing the repository to revision 10, and then a whole slew of changes in branches and tags brings the repository to revision 1000, then 10 will be the "last changed revision" for the trunk folder, but the current revision number of the entire repository would be 1000.