gpt4 book ai didi

svn - 如何在颠覆中将维护分支中的错误修复合并回主干

转载 作者:行者123 更新时间:2023-12-04 04:19:26 27 4
gpt4 key购买 nike

在 svn 书 ( http://svnbook.red-bean.com/en/1.7/svn.branchmerge.commonpatterns.html ) 的通用分支模式部分,它说:

The trunk is copied to a “release” branch. When the team thinks the software is ready for release (say, a 1.0 release), /trunk might be copied to /branches/1.0.

Teams continue to work in parallel. One team begins rigorous testing of the release branch, while another team continues new work (say, for version 2.0) on /trunk. If bugs are discovered in either location, fixes are ported back and forth as necessary. At some point, however, even that process stops. The branch is “frozen” for final testing right before a release.

(强调我的)。我假设维护分支与发布分支相同..? (我们需要在开发他们的下一个版本时让一个客户使用以前的版本)。

我很确定我不应该使用 --reintegrate,但我不太确定如何以不会弄乱 future 合并的方式进行合并。我是否需要手动跟踪修订范围? ..或者颠覆会为我做这件事(我使用的是 1.7.6 版)。

[编辑:更多细节]

trunk> svn mkdir c
trunk> touch a.txt b.txt c\d.txt
trunk> svn add a.txt b.txt c\d.txt
trunk> svn ci -m "initial trunk"
...
Committed revision 9580.

trunk> svn copy .../trunk .../branches/branch1 -m "create maint branch"
Comitted revision 9581.

trunk> svn rm c\d.txt
trunk> svn ci -m "Fix bug-1."
Deleting c\d.txt

Committed revision 9582.

branch1> svn merge .../trunk
--- Merging r9581 through r9582 into '.':
D c\d.txt
--- Recording mergeinfo for merge of r9581 through r9582 into '.':
U .

branch1> svn ci -m "Merged fix for bug-1 from trunk."
Deleting c\d.txt
Committed revision 9583.

branch1> svn propget svn:mergeinfo .
/svntests/trunk:9581-9582

trunk> svn up
Updating '.':
At revision 9583.

[原问题]

trunk> svn merge .../branches/branch1
--- Merging r9581 through r9583 into '.':
C c\d.txt
--- Recording mergeinfo for merge of r9581 through r9583 into '.':
U .
Summary of conflicts:
Tree conflicts: 1

[来自@JB Nizet 的修复]

trunk> svn merge -c 9583 --record-only .../branch1
--- Recording mergeinfo for merge of r9583 into '.':
U .

trunk> svn propget svn:mergeinfo .
/svntests/branches/branch1:9583

然后来自维护分支的 future 合并将工作(正确更新 trunk 上的 mergeinfo)而不会产生冲突:

trunk> svn merge .../branch1

最佳答案

发布分支用于准备发布的最后步骤。维护分支用于在发布完成后修复错误。都是分支,纯粹是语义上的区别,但还是有区别的。

要合并你的错误修复,你只需确保你的工作副本指向主干(目标分支),然后从维护分支合并(或者如果你不想合并所有内容,则从维护分支的修订范围合并):

svn merge url_of_the_maintenance_branch

下次合并会记住这些修订已经合并到主干中,并自动跳过它们。

关于svn - 如何在颠覆中将维护分支中的错误修复合并回主干,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12515376/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com