Reputation: 38714
This afternoon, upon noticing a broken build and the fact that some files looked like very old versions (about 2 weeks old), I checked the svn log. Apparently just this afternoon, 1 of the developers did an "svn copy" of a directory from an older revision to the same directory. Thus it appears that the latest version "i.e. head" of all the files in that directory are really old, and all the history "i.e. log" is even older.
However, I think I can recover by using another "svn copy" (i.e. the disease is the cure). What I am considering doing is finding the revision where the bad "svn copy" was done (say rev 1234) , subtracting 1 (1233) and doing:
svn copy -r 1233 file://path/to/messed/up/dir file://path/to/messed/up/dir
That should restore the latest version, as well as get back all my history. Am I right about this?
Upvotes: 1
Views: 1496
Reputation: 2811
According to the SVN book,
svn merge -c -1234
should do the trick.
There's a whole section about this in the book.
The verbose explanation:
-c -1234
translates into -r 1234:1233
, which reverts the change from revision 1234.
Upvotes: 7
Reputation: 127467
This copy command doesn't work for two reasons:
To fix this, you need to
remove the current dir object:
svn rm file:///path/to/messed/up/dir
Copy using "peg revisions"
svn cp file:///path/to/messed/up/dir@1233 file:///path/to/messed/up
Upvotes: 1
Reputation: 15568
Probably, but make a backup first.
Actually, I'm left wondering why you don't have a daily backup that you can just restore from already... Your SVN repository is surely important enough for that?
Upvotes: -2