Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 959
Wim Avatar asked Dec 07 '09 09:12

Wim


People also ask

Will svn update overwrite my changes?

When you update, the contents of your working copy are updated with all of the changes that have been committed to the repository since you last updated. Subversion is pretty smart about updating and never just overwrites files that have local changes with copies from the repository.

Which command is used to update to the latest revision svn?

Simply type svn update [name-of-directory] , or cd to that directory and type svn update there.

How does svn revision number work?

Unlike most version control systems, Subversion's revision numbers apply to the entire repository tree, not individual files. Each revision number selects an entire tree, a particular state of the repository after some committed change.


1 Answers

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.

like image 182
Michael Aaron Safyan Avatar answered Oct 19 '22 13:10

Michael Aaron Safyan