将一个文件移动到另一个文件之上后合并颠覆历史记录? [英] Combining subversion history after moving one file on top of another?

查看:53
本文介绍了将一个文件移动到另一个文件之上后合并颠覆历史记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个 subversion 存储库中,有一个二进制文件(MS Word 文档),具有很长的更改历史.最近,该文件被以下有问题的操作修改,丢失了历史记录.首先,制作了一个副本并提交到存储库:

In a subversion repository, there is a binary file (MS Word document) with a long history of changes. Recently, the file was modified by the following problematic operations, losing the history. First, a copy was made and committed to the repository:

$ cp original.docx copy.docx
$ svn add copy.docx
$ svn commit

接下来,副本被多次编辑和提交.(original.docx 再也没有被修改过.)

Next, the copy was edited and committed many times. (original.docx was never modified again.)

最后,使用svn mv"将原始文件替换为副本:

Finally, the original file was replaced by the copy using "svn mv":

$ svn mv original.docx oldjunk.docx
$ svn mv copy.docx original.docx
$ svn commit

这很糟糕,因为svn log original.docx"不再找到original.docx"的大部分历史记录——历史记录在oldjunk.docx"中.

This is bad because much of the history of "original.docx" is no longer found by "svn log original.docx" -- the history is in "oldjunk.docx".

作者打算在未来svn rm oldjunk.docx",这将失去所有历史.允许该命令的最佳颠覆操作顺序是什么:

The author intends to "svn rm oldjunk.docx" in the future, which would lose all that history. What is the best sequence of subversion operations that would permit the command:

$ svn log original.docx

显示附加(现在称为) original.docx 和 oldjunk.docx 的历史记录?

to show the appended history of (what is now called) original.docx and oldjunk.docx?

记住这些是二进制文件,所以我们不能随意合并内容.

Remember these are binary files so we can't arbitrarily merge content.

谢谢.

推荐答案

  1. svn log original.docx now 必须显示 copy.docx original.docx的历史记录(由于正确的重命名)
  2. 即使从仍然存储在历史记录中的存储库文件中删除,并且可以从存储库中提取此历史记录(阅读有关 PEG-revisions 的信息):即如果 oldjunk.docx 将在 $REVISION 中删除(您可以找到这个修订来自 svn log -v),对于 $N = $REVISION - 1svn log oldjunk.docx@K 你将能够获取 original.docx + oldjunk.docx 的历史
  1. svn log original.docx now must show history of copy.docx and original.docx (due to correct rename)
  2. Even deleted from repository file still stored in history and this history can be extracted from repository (read about PEG-revisions): i.e. if oldjunk.docx will be removed in $REVISION (you can find this revision from svn log -v), for $N = $REVISION - 1 in svn log oldjunk.docx@K you will be able to get history of original.docx + oldjunk.docx

您可以(理论上)使用很多技巧和黑魔法重写存储库中的历史记录,并通过正确的修改替换cp original.docx copy.docx,但是:

You can (theoretically) with a lot of tricks and black magic rewrite history in repository and replace cp original.docx copy.docx by correct revision with nice change, but:

  • 这将需要大量艰苦而准确的工作
  • 它需要对存储库和存储库服务器的管理级别访问(必须在过程中创建中间存储库)

这篇关于将一个文件移动到另一个文件之上后合并颠覆历史记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆