1

我需要将一些分支 repo 合并到另一个中,但是,我错误地使用了“svn copy”,它覆盖了目标存储库,因此一些文件丢失了。好消息是我每天都有使用 `svnadmin dump' 创建的备份,但我不确定如何最好地恢复丢失的文件并保留以后添加的新文件。

我在想这样做:

  1. 创建一些 svn 临时存储库
  2. 使用“svn 加载 /path/to/the/temp-repository/
  3. cd /path/to/the/temp-repository/
  4. 递归删除所有 .svn 目录
  5. 转到我已覆盖的分支并使用 rsync 将丢失的文件发送到工作存储库。

不确定这是否是最好的方法。有什么想法吗 ?

4

1 回答 1

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
于 2012-11-08T06:04:59.777 回答