Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion working copy newer than server because of rollback from backup

Tags:

svn

So, my server administrator rolled back the subversion server from a backup. My working copy is at revision 1534, but the server is now at 1525, which yields some problems:

$ svn up
svn: Revision 1534 not found

Of course, there is always the option to do a clean checkout, but is there an easier way to get my local working copy in sync with the server?

like image 512
rlovtang Avatar asked Nov 07 '09 15:11

rlovtang


3 Answers

There is way to do this I have just discovered - as long as you have a reasonably up-to-date version Tortoise SVN on your machine and your working copy was maintained by this version (i.e simply installing the latest Tortoise SVN wont work).

Go into the top-level directory and delete the .svn folder - this will remove all of the locally cached SVN information. Note: the .svn folder only appears in the top level checked out folder and is hidden.

Then checkout over the top of your existing local copy. Tortoise will then re-version the files, importantly leaving your modified files alone. You'll then be able to commit changes and update without any problems.

like image 61
Martin Avatar answered Sep 19 '22 20:09

Martin


Your working copy IS NOT DEAD. Yes, you could check out again... but in my case that is over 20GB and would take very long time.

All I needed to take care of few files, which were newer on working copy, than on the server repository (also due to roll back).

What you can do, is to make a quick SPARSE CHECKOUT (check out only one directory) to temporary location. Next, from this partial checkout location, you take the hidden .svn file (the history of that directory), and place it to your problematic working copy (which holds newer history).

This will not affect your source text files, only give them older, but repository matching history. The Commit text since the rollback time is lost, but that is easy to retype.

After I did that, the svn worked fine and showed all the changes I made since the rollback time. Of course, you must COMMIT those changes again.

like image 29
EmbeddedGuy Avatar answered Sep 18 '22 20:09

EmbeddedGuy


You have to check out again.

Your working copy is dead.

Your admins should really try to sync their back up on each commit or storing the commits as dumps via hook script

If you are using Windows/TortoiseSVN, please look at Martins answer below.

like image 37
Peter Parker Avatar answered Sep 20 '22 20:09

Peter Parker