v1.6 中重新集成 Subversion 分支
根据这个老问题,使用 SVN 1.5,多次重新集成分支是有问题的,应该避免。
有一些传言说,“这是一个已知问题,应该在 SVN 1.6 中修复。”是这样吗?固定了吗?我可以多次重新融入吗?
Per this old question, using SVN 1.5, reintegrating a branch multiple times is problematic, and should be avoided.
There has been some rumbling to the effect that, "This is a known issue, and should be fixed in SVN 1.6." Was that the case? Is it fixed? Can I reintegrate multiple times?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要将分支主题重复合并到主干:在每次合并时执行以下操作。
svn merge --reintegrate;
,就像平常一样。 (=> r
M
)svn merge --record-only -c M ^/; <主题>。 注意
record-only
选项。第2步本质上告诉主题分支考虑合并提交(修订版
M
,来自其历史的步骤 1) 的一部分。这种合并修订通常会在重新集成过程中引起问题; svn 在第二次集成 topic 时尝试撤消 rM。因此,重复的重新整合是有效的,只是不是自动的。 :)
我最终通过 对 svn 源的启发性提交消息找到了这个解决方案 和匹配的 测试(搜索“def multiple_reintegrates”)。这是 svn-devs 在当前版本中发现和使用的“聪明技巧”。它甚至被添加到更新的版本中文档。结果仍然不如 DVCS 的合并特性,但它至少是实用的。
唯一的广泛缺点(根据截至 6 月 2 日的未决问题, 2010),显然 svn log -g 输出很混乱。我想这就是风险。
To merge a branch topic into the trunk repeatedly: Do the following on every merge.
svn merge --reintegrate <topic> <trunk>
, as you would normally. (=> r
M
)svn merge --record-only -c M ^/<trunk> <topic>
. Note therecord-only
option.Step 2 essentially tells the topic branch to consider the merge commit (revision
M
, from step 1) part of its history. This merge-revision is the one that usually causes problems during reintegration; svn tries to undo rM when integrating topic a second time.So, repeated reintegration works, just not automatically. :)
I eventually found this solution through an enlightening commit message to the svn source and the matching test (search for "def multiple_reintegrates"). This is a "clever trick" discovered and used by svn-devs with the current releases. It's even been added to more recent documentation. The result is still not as good as a DVCS's merging properties, but it's at least functional.
The only broad downside (as per an open issue as of June 2, 2010) is that apparently the
svn log -g
output is messy. I guess this is the risk.是的,你可以。你问的问题已经在 Subversion 1.8 中解决了。
从 SVN 1.8 开始,
--reintegrate
选项已弃用,并且重新集成合并现在自动(或自动)执行<强>:))。请参阅 Subversion 1.8 发行说明并阅读更新的SVNBook 1.8 |重新集成分支章节:重要: 您应该升级您的 Subversion 客户端和服务器,如果您仍然使用 Subversion 1.7 或更早版本。截至 2016 年,SVN 的当前最佳版本是 1.9。没有真正的理由使用非常旧的 Subversion 版本,例如 1.5、1.6 甚至 1.7。自 1.6 版本以来,客户端和服务器端都有大量改进!
Yes, you can. The problem you ask about was solved in Subversion 1.8.
Beginning with SVN 1.8,
--reintegrate
option is deprecated and reintegrate merges are now performed automatically (or automagically :) ). See Subversion 1.8 Release Notes and read updated SVNBook 1.8 | Reintegrating a branch chapter:IMPORTANT: You should upgrade your Subversion client and server if you still use Subversion 1.7 or older. The current and best version of SVN is 1.9 as of year 2016. There is no real reason to be using very old Subversion releases such as 1.5, 1.6 or even 1.7. There were numerous improvements on client and server side since version 1.6!
虽然 1.6 确实解决了合并跟踪问题,但我认为您不能重复使用集成分支。
但这不是问题。由于分支已完全集成到主干中,因此只需删除它并在其位置创建一个新分支(具有相同的名称)即可。
While 1.6 did indeed fix issues with merge tracking, I don't think you can re-use an integrated branch.
But this is not an issue. Since the branch got fully integrated into the trunk, just delete it and create a new branch (with the same name) in its place.