在Mercurial中执行增量合并的最简单方法 [英] Easiest way to perform incremental merge in mercurial

查看:89
本文介绍了在Mercurial中执行增量合并的最简单方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,已经分支了一段时间.自拆分以来,两个分支都有很多提交,我想将它们合并为一个.仅仅合并两个头是不够的,因为它存在太多冲突,并且合并后的分支也不稳定且无法正常工作.

I have a project, that have branched sometime. Both branches have had a lot of commits since the split, and I want to merge them into one. Simply merging the two heads is not enough because it has too many conflicts, and the merged branch is also unstable, and non-functional.

因此,我想逐步合并两个分支.增量表示我指的是我摘取一个分支的尖端,然后一次应用来自另一个分支的更改.测试每个合并,如果一切顺利,则继续.

Therefore I want to incrementally merge the two branches. By incremental I mean I take the tip of one of the branches and apply the changes from the other one one at a time. Testing each merge, and continuing if everything goes well.

使用水银最简单的方法是什么?

What is the easiest way to do this using mercurial?

推荐答案

您自己已经概述了一项策略.假设您有两个head,分别称为headA和headB. hg up -r headB移至两个头之一,然后重复使用hg merge -r X,其中X是沿另一条开发线的修订版.

You've pretty much outlined a strategy yourself. Assume you have two heads, named headA and headB. hg up -r headB to one of the two heads, then use hg merge -r X repeatedly, where X is a revision along the other line of development.

您可以使用hg log -r 'ancestor(headA,headB)::headA'获取这些合并的良好候选列表(取决于整体拓扑).

You can use hg log -r 'ancestor(headA,headB)::headA' to get a list of good candidates for these merges (depending on overall topology).

这篇关于在Mercurial中执行增量合并的最简单方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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