简体   繁体   English

合并svn功能分支到发布分支

[英]merge svn feature branch to release branch

I have a trunk, from which I created a release branch (and I have done work on it, already committed). 我有一个主干,从中创建了一个发布分支(并且我已经完成了它的工作,已经提交了)。 After this, I created a feature branch from the trunk, and now I'm ready to reintegrate it in the trunk, using svn merge --reintegrate. 之后,我从主干创建了一个功能分支,现在可以使用svn merge --reintegrate将其重新集成到主干中了。

However, I realized that I need all the changes implemented in the feature branch also on the release branch. 但是,我意识到我还需要在发布分支上的功能分支中实现的所有更改。 In my mind, the command would be 在我看来,命令是

svn merge ^/feature_branch release_branch_local_pach

and then reintegrate the feature branch in the trunk 然后将功能分支重新整合到主干中

cd feature_branch_local_path
svn merge ^/trunk && svn ci -m "sync of feature with trunk"
cd trunk_local_path
svn merge ^/feature_branch --reintegrate && svn ci -m "feature reintegrated in trunk"

Is it correct? 这是正确的吗? Do I have to provide some revision number to the first merge command? 我必须为第一个合并命令提供一些修订号吗? I use svn 1.8.13, and I have never merged without a --reintegrate. 我使用svn 1.8.13,并且在没有--reintegrate的情况下从未合并。

I am not sure if first merge will works always correctly. 我不确定第一次合并是否总是可以正常工作。 If you has sync merged from trunk into branch, then them also will be moved into release branch and I suggest it will not be what you want. 如果您已将同步从主干合并到分支中,那么它们也将被移入发布分支,我建议这不是您想要的。

May be better strategy will be merge only selected revisions (cherry picking): 可能更好的策略是仅合并选定的修订(樱桃采摘):

svn merge -c 100,105,107 ^/feature_branch release_branch_local_pach

(where 100,105,107 - revisions which should be merged) (其中100,105,107-应合并的修订版本)

And also, if you want to continue merge from release branch to trunk, you need block cherry pick result revision in trunk. 而且,如果要继续从发行分支到主干合并,则需要在主干中阻止“樱桃挑选”结果修订。 Say you commit cherry pick as revision 120, then 假设您将樱桃精选作为修订版120,然后

svn merge -r 120 ^/release_branch trunk_local_pach --record-only
svn commit -m "Block revison 120 from remerge"

In this case next time when yoy try merge release branch into trunk, subversion will not try merge revisions 100, 105, 107 second time (first time they was merged during reintegrate merge) 在这种情况下,下一次尝试将发布分支合并到主干时,Subversion将不会第二次尝试合并修订版本100、105、107(在重新整合合并期间首次将它们合并)

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

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