1

I needed to merge some branch repo into another and instead, by mistake, I have used "svn copy" which had overwritten the destination repository and so some of the files were lost. Good news is that I have daily backups created with `svnadmin dump' but I'm not that sure how it's best to proceed in order to restore that lost files and also keep the new ones which have been added later.

I was thinking doing like this:

  1. create some svn temporary repository
  2. use "svn load /path/to/the/temp-repository/
  3. cd /path/to/the/temp-repository/
  4. remove all .svn dirs recursively
  5. go to the branch that I have overwritten and use rsync to send the lost files to the working repository.

Not sure if this is the best approach. Any thoughts ?

cparfon
  • 157
  • 1
  • 3
  • 13

1 Answers1

1

I have better news for you

Subversion store all history between changes.

When you accidently svn copy you added additional commit into destination branch. You can

  • svn up GOODREV to good commit (or svn co BRANCH@GOODREV into fresh WC) and commit (minor edit-save-commit) on top of bad
  • Undo bad commit by reverse-merge

For svnadmin dump

You have to identify, are these backups incremental (--incremental) or full. In case of full you have to find backup, in which GOODREV exist, svnadmin load this dump into new repo, svn copy from NEW-REPO branch to OLD-REPO branch, kill restored repository

Hint: you have to learn repository administration better: pp. 4-5 is just delirium - SVN repository have absolutely different file-tree and repostory's subtree doesn't exist as physical tree of same structure (and .svn files are Working Copy attribute and storage of WC-metadata)

Bust logical and better (than your) usage of svndump is, again, different. If you still want hide your error from eyes, you have

  • Create new, full dump for the range of revisions (-r LOWER:UPPER option), which will exclude BADREVISION.
  • Disable all connection
  • Remove old repository (rm REPODIR + mkdir REPODIR)
  • Restore repo from dump
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • Hm. I'm still confused. Actually before using `svn copy` I have used `svn del` to remove that branch first and then svn copy from another branch. Could I still restore it? – cparfon Nov 08 '12 at 06:40
  • How about the files which have been added later to that branch ? – cparfon Nov 08 '12 at 06:42