简体   繁体   English

如何在重新整合时删除挥之不去的svn:mergeinfo属性?

[英]How to remove lingering svn:mergeinfo properties on reintegrate?

I wanted to work on a small set of changes independent from my other development on a project. 我想独立于项目的其他开发工作进行少量更改。 I've been using this as a guide. 我一直以此为指导。

I started off by doing a svn cp from /trunk/app/module to /branches/pete/feature-branch, this was r393 我从/ trunk / app / module到/ branches / pete / feature-branch的svn cp开始,这是r393

After some changes, and merges from back and forth between the trunk and branch to keep things up to date, I was finished with my feature, and went back to working on the trunk. 进行一些更改后,在主干和分支之间来回合并以保持最新状态,我完成了我的功能,然后又开始在主干上工作。

A couple few revisions later, I decided maybe I should clean up my feature branch so I tried to reintegrate it. 几处修订之后,我决定也许应该清理功能分支,以便尝试重新集成它。

  1. I checked out a fresh copy of the feature branch and trunk. 我签出了功能分支和主干的新副本。
  2. I merged the trunk changes into the feature branch and committed them 我将主干更改合并到功能分支中并提交了它们
  3. I then did a merge --reintegrate ^/branches/pete/feature-branch on the trunk resulting in r434 然后,我在主干上进行了合并--reintegrate ^ / branches / pete / feature-branch,生成了r434

Everything looks OK from the code point of view, but now my trunk/app/module still has a svn:mergeinfo property. 从代码的角度来看,一切看起来都不错,但是现在我的trunk / app / module仍然具有svn:mergeinfo属性。

$ svn pg svn:mergeinfo
/branches/pete/feature-branch:393-433

From what I understand, svn:mergeinfo should be empty and these revisions should be "elided" or is this OK ? 据我了解,svn:mergeinfo应该为空,这些修订应该被“删除”,或者这样行吗?

This information on the subfolder shows you that you (accidentally?) merged on a subfolder (not on trunk, but on /trunk/app/module). 子文件夹上的此信息显示(偶然吗?)您在子文件夹上合并(不是在主干上,而是在/ trunk / app / module上)。

Subversion knows now that it will not merge these revisions from this branch again. 现在,Subversion知道它将不再合并来自此分支的这些修订。 Usually you should only merge on the topmost folder, so the mergeinfo is only on this folder. 通常,您只应在最顶层的文件夹上进行合并,因此mergeinfo仅在此文件夹上。

To merge only a subdirectory is not recommended by SVN-Team ( See SVN book topic here ) SVN-Team不建议仅合并一个子目录( 请参阅SVN书主题

Avoid subtree merges and subtree mergeinfo. 避免子树合并和子树mergeinfo。 Perform merges only on the root of your branches, not on subdirectories or files (see the section called “Subtree Merges and Subtree Mergeinfo”) . 仅在分支的根目录上执行合并,而不在子目录或文件上执行合并(请参阅“子树合并和子树合并信息”部分)。

Still all merges are possible, but you end up with a lot of (different) mergeinfos on different folderlevels, which makes it later harder to figure out what is going on and why SVN behaves this way. 仍然可以进行所有合并,但是最终会在不同的文件夹级别上得到很多(不同的)mergeinfo,这使得以后很难弄清正在发生什么以及为什么SVN如此行为。

Also it is always possible (not recommended!) to delete the merge-info property, to "reset" the mergetracking feature. 此外,总是有可能(不建议这样做!)删除merge-info属性,以“重置” mergetracking功能。 Mostly done by also deleting the branch as well. 通常也通过删除分支来完成。 Then the risk of a second merge is usually negligible. 这样,第二次合并的风险通常可以忽略不计。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM