重新整合到主干后,使用Subversion功能分支是否安全? [英] Is it safe to use a subversion feature branch after reintegrate-merged to trunk?

查看:89
本文介绍了重新整合到主干后,使用Subversion功能分支是否安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

功能分支合并(重新集成)回主干后是否必须删除?

Must a feature branch be deleted after it's merged (reintegrated) back to trunk?

我更喜欢不断地从功能分支来回合并更改-我相信这会将冲突降到最低.但是我知道,一旦您使用重新整合合并到主干,就应该删除功能分支.

I prefer to constantly merge changes back and forth from my feature branch - I believe this keeps the conflicts to a minimum. Yet I understand that once you use the reintegrate merge to trunk, a feature branch should be deleted.

是吗?为什么?我该怎么做才能避免这种情况?

Is it so? Why? What can I do to circumvent this?

更新 我在问的是该工具带来的技术问题,而不是方法论方面的问题".合并后,我打算继续处理功能分支.

Update I'm asking about technical problems that come from the tool, not "methodology concerns". I intend to keep working on the feature branch after the merge.

更新,最上面的答案确实指定了一个相当复杂的过程(合并,删除和重新分支).在TortoiseSVN中有一种简单的方法可以完成此操作吗?不应该吗?

Update the top answer indeed specifies a rather complex procedure (merge, delete & rebranch). Is there an easy way to accomplish this in TortoiseSVN? Shouldn't there be?

推荐答案

编辑:此问题似乎已在SVN 1.8中修复.

edit: This problem appears to have been fixed in SVN 1.8. The section on basic merging from the SVN 1.8 book has been updated to say that it is OK to reuse a feature branch. The answer below is only relevant for older SVN versions.

摘录自基本合并 svn书:

在Subversion 1.5中,一次 --reintegrate合并从分支到主干完成,分支为否 可以用于进一步的工作.它是 无法正确吸收新的后备箱 变化,也不能适当 重新整合到树干.为了这 原因,如果您想继续努力 您的功能分支,我们建议 销毁它,然后重新创建 从后备箱:

In Subversion 1.5, once a --reintegrate merge is done from branch to trunk, the branch is no longer usable for further work. It's not able to correctly absorb new trunk changes, nor can it be properly reintegrated to trunk again. For this reason, if you want to keep working on your feature branch, we recommend destroying it and then re-creating it from the trunk:

在SVN 1.6和1.7中仍然如此.

This is still the case in SVN 1.6 and 1.7.

这篇关于反思性合并的优秀文章解释了为什么确切地说,您不能或不应该回收功能分支.最重要的要点总结:

This excellent article on reflective merges explains why exactly you can't or shouldn't recycle a feature branch. Summary of the most important points:

  • 您可以努力解决冲突 与行李箱重新整合时
  • 重新整合在主干中的提交 因此包含两个变化 来自功能分支 解决冲突的工作
  • 但是,颠覆对您没有帮助 合并此冲突解决工作 回到功能分支.它只是 看着mergeinfo并认为 这些变化最初来自 功能分支,无需合并 他们又回到了他们的起源."
  • you may do work to resolve conflicts when reintegrating with the trunk
  • The reintegration commit in trunk therefore contains both changes coming from the feature branch and conflict resolution work
  • However, subversion will not help you merge this conflict resolution work back to the feature branch. It simply looks at the mergeinfo and thinks "these changes originally came from the feature branch, no need to merge them again to their origin".

删除功能分支和重新分支很便宜,并且可以避免整个问题.

Deleting the feature branch and rebranching is cheap and avoids this whole issue.

这篇关于重新整合到主干后,使用Subversion功能分支是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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