Mercurial:分支之间的合并...倒退?

发布于 2024-09-30 00:31:36 字数 696 浏览 1 评论 0原文

情况:我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜夜流光相皎洁 2024-10-07 00:31:36

有两种方法可以做到这一点。正确的一种和方便的一种。我将首先做正确的一个:

hg update default
hg --config ui.merge=internal:other merge vendor

将您的父级更新为默认值,将工作目录更新为默认值,然后合并供应商的内容,但使用内部合并工具总是选择另一个存在任何差异时的选项,因此在合并(和提交)后您将默认看起来像供应商。

偷偷摸摸的方法是:

hg update -C vendor
hg debugsetparent default
hg commit

其中 debugsetparent 是一个强大的工具,它执行更新的“父级更改”部分,而无需实际更新工作目录中的文件。

There are two ways to go this. The right one and the expedient one. I'll do the right one first:

hg update default
hg --config ui.merge=internal:other merge vendor

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:

hg update -C vendor
hg debugsetparent default
hg commit

Where debugsetparent is a powertool that does the "parent change" part of update without actually updating the files in the working directory.

无妨# 2024-10-07 00:31:36

虽然它缺乏这个问题及其答案提供的上下文,但我在 Mercurial 的 Wiki 上找到了 官方答案

Though it lacks the context this question and its answers provides, I found the official answer on Mercurial's Wiki.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文