Mercurial:分支之间的合并...倒退?
情况:我是 Mercurial 的新手。我最近设置并开始使用向我推荐的模型中的存储库(请参阅下面鲁迪的图表)。一切进展顺利,但我遇到了第一个实际应用问题。 Mercurial 似乎适合前向/混合合并,我想备份。我想从供应商分支开始清理我们的默认和稳定分支,重新进行更改并将其签入为默认分支。然后将其合并到稳定中。
V1----V2-------------V3---------V4 Vendor
\ \ \ \
D1----D2---D3--D4-D5-D6-D7-D8---D9 default
\ \ \
S1----------S2---S3 stable
问题:如何以供应商分支作为父分支开始,合并默认更改并将它们提交到默认分支?
我认为以下内容可以做到这一点,但更新更改了工作目录。
hg update -C vendor
hg update default
hg merge
The Situation: I am new to Mercurial. I recently setup and have started using a repository in a model recommended to me (see Rudi's diagram below). Things have been going fine but I have run into my first practical application problem. Mercurial seems to be geared toward forward/blended merges and I would like to backup. I want to clean up our default and stable branch by starting with the vendor branch, re-make our changes and check it in as default. Then merge that into stable.
V1----V2-------------V3---------V4 Vendor
\ \ \ \
D1----D2---D3--D4-D5-D6-D7-D8---D9 default
\ \ \
S1----------S2---S3 stable
The Question: How do I start with the vendor branch as the parent, merge the default changes and commit them to the default branch?
I thought the following would do it, but the update changes the working directory.
hg update -C vendor
hg update default
hg merge
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有两种方法可以做到这一点。正确的一种和方便的一种。我将首先做正确的一个:
将您的父级更新为默认值,将工作目录更新为默认值,然后合并供应商的内容,但使用内部合并工具总是选择另一个存在任何差异时的选项,因此在合并(和提交)后您将默认看起来像供应商。
偷偷摸摸的方法是:
其中
debugsetparent
是一个强大的工具,它执行更新的“父级更改”部分,而无需实际更新工作目录中的文件。There are two ways to go this. The right one and the expedient one. I'll do the right one first:
That updates your parent to default and the working directory to default and then merges in the contents from vendor, but does so using an internal merge tool that always picks the other option when there's any difference, so you'll have default looking like vendor after that merge (and commit).
The sneaky way is:
Where
debugsetparent
is a powertool that does the "parent change" part of update without actually updating the files in the working directory.虽然它缺乏这个问题及其答案提供的上下文,但我在 Mercurial 的 Wiki 上找到了 官方答案。
Though it lacks the context this question and its answers provides, I found the official answer on Mercurial's Wiki.