Reintegrate merge claims missing revisions with numbers lying before branch creation

时间:2015-07-28 16:06:51

标签: svn tortoisesvn

During SVN reintegrate-merge (TortoiseSVN/Windows), I get the following errors:

Command: Auto-merge /svn/branches/branchX into C:\MyRepoFolder
Error: Reintegrate can only be used if revisions 59635 through 65976 were previously
Error: merged from svn/trunk to the reintegrate source, but this is not the case:
Error:
Error: svn/branches/branchX/Applications/.../source/someFile.cpp
Error:
Error: Missing ranges:
Error: /trunk/Applications/.../source/someFile.cpp:43835,43956,43965,...
...
(and so on)
...

The branch was created at Rev 59635, why are are older ranges around 43835 missing when the branch was created from trunk in the past? Can someone please tell me how this is possible and how to solve the issue?

I have already tried many things including:

  • trunk -> branch: auto merge of problematic revisions
  • trunk -> branch: record only merge of these old revisions
  • adding revisions to corresponding merge-info

The latter did work, but doing this manually is very exhaustive since the list is extremely long (I have listed only a fraction here). All other attempts did not work. But I don't think that manually adding the the revisions to the corresponding merge-infos is the best solution here. Maybe I can write a script that does it automatically. I would be very interested in alternatives? I can't imagine that there is no better solution here.

1 个答案:

答案 0 :(得分:1)

我怀疑这个问题是使用的不同svn版本的组合,以及子树合并。单独的第一个根本不是问题,但是子树合并是持续头痛的主要来源。

我的建议:找出repo的维护者是否有子树合并策略,即,他们是否明确允许或禁止合并不仅仅是在分支的根级别,而且还有单个文件或子文件夹。

如果他们允许的话:抱歉,你被搞砸了。尝试找到进行子树合并的人,并询问他们是否仍然使用这个子树合并信息(以及他们在第一时间做的时候的想法)。

如果不允许子树合并(或者您是repo的唯一维护者),只需删除所有子树合并信息,但保留在根级别。您可以这样做,例如转到 clean 分支工作副本的根目录并执行

svn pd svn:mergeinfo . -R
svn revert . 

第一个命令将递归删除所有合并信息(包括坏东西),第二个命令将在分支根恢复有用和必要的合并信息。在继续之前,请确保您没有更改任何其他内容(如果您做得正确,svn st应仅在第二列显示一堆文件/文件夹M ,表示只有属性被更改)并提交。之后,重新融入应该再次发挥作用。

请注意:svn:mergeinfo属性为“sticky”,因此一旦将trunk再次合并到您的分支(或使用子树合并信息重新集成其他分支),将再次出现错误的合并信息属性。要真正摆脱它们,您需要删除主干本身中的子树合并信息,并强制所有用户在重新集成回主干之前对其分支执行相同操作。我们在一年前遇到了类似的问题,我们所做的是检查整个分支/子文件夹并运行脚本以同时删除所有分支中的所有不必要的合并信息。