views:

346

answers:

4

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)

+5  A: 

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.

Ben Scheirman
+5  A: 

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.

Grant
+1  A: 

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
Josef
A: 

You can fill in the missing revision numbers by loading in a dump file with a bunch of empty revisions. There are answers discussing how to do this over at How can I change the revision number of a repository. Load all but one revision this way, then you can just check in all your changes in one last giant revision.

puetzk