Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I force revert back so a specific revision number using command line SVN?

I spoke too soon in my previous post about breaking things.

I am trying to revert back to revision 1124 using the command svn update -r 1124 but I keep getting an error message as follows:

[prague]$ svn update -r1024
U    app/webroot/css/group_themes/green.css
U    app/webroot/css/style.css
Skipped 'app/webroot/index.php'
svn: Failed to add directory 'app/webroot/images/users': an unversioned directory of the same name already exists

We got some stuff back up but still not the exact version which I know I had checked out last night... I thought it would be much easier to just revert back to a specific revision :(

like image 466
adam Avatar asked Mar 02 '11 08:03

adam


2 Answers

Without commit

Try to checkout revision 1124 in a new empty directory, so you won't have conflicts with already existing directories.

So svn checkout -r 1124 in a new directory.

With commit

According to the svn manual, if you want to commit a previous revision, you need to use reverse merging. See http://svnbook.red-bean.com/en/1.0/ch04s04.html, 'Undoing Changes'.

svn merge -c -1124 http://svn.example.com/repos/calc/trunk followed by

svn commit -m "Rollback merge to revision 1124"

like image 64
red Avatar answered Nov 15 '22 04:11

red


Failed to add directory 'app/webroot/images/users': an unversioned directory of the same name already exists

Sounds clear to me: there already is a directory with that name, and it's not versioned. You can opt for two things: either remove the directory and update again, or rename (probably smartest) and update again.

 $ mv app/webroot/images/users app/webroot/images/users.orig/
 $ svn update -r1024

As an aside, do yourself a favour and look at some of the alternatives to SVN, such as Mercurial, Bazaar or Git. I've found the switch to be very pleasant ;)

like image 40
Berry Langerak Avatar answered Nov 15 '22 04:11

Berry Langerak