我从我的主干创建了一个名为"feature3"的分支.我对"feature3"分支上的文件进行零修改.在trunk上也没有对文件进行修改.使用TortoiseCVS(TortoiseSVN 1.6.6,Build 17493 - 32 Bit)对抗SVN(版本1.6.3(r38063))repo,我启动了一个"Merge",选择了"Reintegrate a branch"选项.
此命令的输出显示合并的80个文件.这些文件唯一改变的是svn:mergeinfo属性.但为什么只有这80个文件呢?我在项目中有数百个其他文件未更改此属性.
以下是在单个文件上更改svn:mergeinfo属性的示例
之前:
/trax/branches/current/Libraries/Security/Specifications/NotSpecification.cs:10292-10783 /trax/branches/feature1/Libraries/Security/Specifications/NotSpecification.cs:11324/trax/branches/feature2/Libraries/Security/Specifications /NotSpecification.cs:11326/trax/branches/int/Libraries/Security/Specifications/NotSpecification.cs:11232-11314 /trax/branches/next/Libraries/Security/Specifications/NotSpecification.cs:10156-10782/trax/branches /trax-1.0.x/Libraries/Security/Specifications/NotSpecification.cs:10191-10291 /trax/branches/upgrade/Libraries/Security/Specifications/NotSpecification.cs:9964-10604 /trax/tags/trax-1.0.0 /Libraries/Security/Specifications/NotSpecification.cs:10178-10190 /trax/trunk/Libraries/Security/Specifications/NotSpecification.cs:6672-9851,11232-11325
后
/trax/branches/current/Libraries/Security/Specifications/NotSpecification.cs:10292-10783 /trax/branches/feature1/Libraries/Security/Specifications/NotSpecification.cs:11324/trax/branches/feature2/Libraries/Security/Specifications /NotSpecification.cs:11326/trax/branches/feature3/Libraries/Security/Specifications/NotSpecification.cs:11328-11334 /trax/branches/int/Libraries/Security/Specifications/NotSpecification.cs:11232-11314/trax/branches /next/Libraries/Security/Specifications/NotSpecification.cs:10156-10782 /trax/branches/trax-1.0.x/Libraries/Security/Specifications/NotSpecification.cs:10191-10291/trax/branches/upgrade/Libraries/Security /Specifications/NotSpecification.cs:9964-10604 /trax/tags/trax-1.0.0/Libraries/Security/Specifications/NotSpecification.cs:10178-10190 /trax/trunk/Libraries/Security/Specifications/NotSpecification.cs:6672-9851,11324-11327
更改是添加了这一行
/trax/branches/feature3/Libraries/Security/Specifications/NotSpecification.cs:11328-11334
最后一行被修改了
/trax/trunk/Libraries/Security/Specifications/NotSpecification.cs:6672-9851,11324-11327
我预计合并会导致合并零文件. 为什么SVN认为这些文件需要合并并且他们的svn:mergeinfo属性发生了变化?有没有办法纠正这个?
这是我应该删除所有80个文件的svn:mergeinfo属性的情况吗?我在这里和这里暗指.
这个简单的示例是大型调查的一部分,我在其中创建一个功能分支,进行多处更改,然后尝试将更改合并回主干.但是,合并通知我在这80个文件上存在多个树冲突.由于所有这些树冲突,我无法使用SVN分支,这一点非常令人沮丧.
Wim*_*nen 12
但为什么只有这80个文件呢?
这些文件有一个svn:mergeinfo属性; 其他人没有.当单个文件和项目子文件夹具有此功能时,它将被称为"子树mergeinfo".一旦文件或文件夹具有"svn:mergeinfo"属性,mergeinfo将在每次合并操作时更新.
如果仅合并项目的根目录,并使用最新版本的SVN客户端,则很少会看到子树mergeinfo.只有项目分支的根文件夹(例如/trunk,/branches/foo)应该有一个svn:mergeinfo属性.
编辑:如果你只是删除子树mergeinfo,那么subversion不知道合并发生了.作为一个消息,subversion可能会尝试再次合并这些修订版本,只要让它选择适合自动合并的修订版本(例如,当你svn merge没有指定-r或-c选项时).在最坏的情况下,这种合并尝试可能会产生一些虚假的冲突,这不是一个大问题; 只需手动解决它们.
更新:Subversion 1.7现在只在必要时更新mergeinfo.从发行说明:
Merges no longer record mergeinfo (describing the merge) on subtrees (that have their own explicit mergeinfo), if the subtree was unaffected by the merge. This should greatly reduce the number of spurious svn:mergeinfo property changes for users who have large numbers of subtrees with explicit mergeinfo.