Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easiest way to perform incremental merge in 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?

like image 202
SztupY Avatar asked Apr 13 '11 20:04

SztupY


1 Answers

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).

like image 65
jkerian Avatar answered Oct 01 '22 00:10

jkerian