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 increme开发者_如何学Pythonntally 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?
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.
You can use hg log -r 'ancestor(headA,headB)::headA'
to get a list of good candidates for these merges (depending on overall topology).
You can use hg transplant to pull specific changesets into a branch.
精彩评论