Some Subversion naming conventions are downright lousy. For instance, “svn revert” reverts your code to some older revision, right? Well that’s what you think, my sensible friend, and you’re wrong! All it does is it reverts your working file to the latest version in the repository, the same thing that can be accomplished with a simple delete and svn update.
So to actually revert to an older version in the repository, you have to issue this madness:
svn merge -rhead:123 http://my/svn/repository ./workingcopy
Where 123 is the number of the old revision to which you want to revert.
7 Comments
Right!!
Thanks. It worked.
Nice tip! Thanks.
Thanks. It worked.
It’s a pain. These SVN people are responsible for so much wasted time. Sure it amounts to billions globally. Version control systems should *just work*. Time to consider alternatives…
Hmm, maybe its easier (although admittedly not straightforward) to just use
svn update –revision N
where N is the revision number you want to go back to. At least you don’t have to look up the web address.
I agree, though, that revert should be able to take a revision number and then just do that…
Thank you @Tim, that tip worked very well for me.
svn up –revision N, where N is the revision you need.
One Trackback
[...] copy of the your project, or even to an earlier copy of a file in your project. Aran has a post, as does robozen telling you you to do this. It is really useful if the log files are up to date – see above. [...]