Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recovering from a slightly out of date subversion repository backup

A problem I ran into a while back I never found a good solution for...

Say you have a working copy checked out from subversion at revision 7500, and the disk holding the current repository dies. You've got a backup of the repository at, say, revision 7450. It's easy to restore the repository backup, but any attempt to use the working copy against it gives an error saying that revision 7500 doesn't exist in the repository.

What is the best way to check in one gigantic revision to bring the content of the repository up to match the content of the working copy and get he working copy back to a functional state?

(Ideally I'd like something easier than having to check out a brand new working copy and then copying over all the files manually - I think at the time the working copies were used to configuration manage servers, so it was a real pain to have to check out clean working copies)

like image 797
Matt Sheppard Avatar asked Sep 11 '08 13:09

Matt Sheppard


3 Answers

You could check out a rev.7450 copy somewhere, then export your 7500 copy (to remove the .svn folders). Drag the exported copy (which is the latest copy) over the 7450 copy. All the new files should simply overwrite the older ones, leaving the .svn folders the same.

Subversion will assume you just made a bunch of changes to 7450, and the next checkin will set it as 7451.

like image 73
Grant Avatar answered Oct 26 '22 09:10

Grant


Do a fresh checkout into a different folder, then use a diff program to create a patch. apply the patch to your new working copy.

like image 35
Ben Scheirman Avatar answered Oct 26 '22 09:10

Ben Scheirman


If you are positive you've got the latest version in your directory, then do this:

  1. Delete the item from the repository
  2. Delete the SVN references from your copy
  3. Check your code in as a new copy.
  4. Check out the code you just checked in
like image 31
Josef Avatar answered Oct 26 '22 07:10

Josef