Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ambiguous merge - picked m action" - what does it mean?

I try to merge:

hg me -r <some-revision>

and get:

<some-file>: ambiguous merge - picked m action

What does it mean?

like image 292
Yaron Cohen-Tal Avatar asked Aug 23 '16 13:08

Yaron Cohen-Tal


1 Answers

This message comes from the merge code when it is handling a "difficult" merge, where there is no "best" lowest common ancestor (LCA) commit in the commit graph. (Instead, there are at least two LCAs—or exactly two in this case since it's tricky to get more than two and I don't think Mercurial can.) If you run with verbose or debug messages enabled, you will see several messages regarding the "bid merge" process. Bid merge is described (not very well, in my opinion) in https://www.mercurial-scm.org/wiki/BidMerge.

The message you saw indicates that the bid-merge algorithm was unsuccessful at choosing a "best ancestor" and Mercurial fell back on its "choose an ancestor at (apparent) random" method.

The lack of a "best LCA" arises from "criss cross merges", where you merge branch A into B and branch B into A. Without such merges there is always a single best LCA, if there is any LCA at all. This does not mean you must avoid such merges, but it does mean you should be aware that if you do make them, you may run into ambiguous merge-base issues.

like image 73
torek Avatar answered Oct 31 '22 20:10

torek