Adding merge --ancestor option?

Martin Geisler mg at lazybytes.net
Tue Mar 13 17:43:23 CDT 2012


Matt Mackall <mpm at selenic.com> writes:

> On Tue, 2012-03-13 at 10:03 -0400, Greg Ward wrote:
>> Hi all --
>> 
>> at work, we regularly get bitten by ambiguous merge ancestors: if two
>> common ancestors have the same distance from the root and both are the
>> maximum distance, ancestor() picks the first one it sees. Sometimes it
>> picks wrong and the user gets stuck resolving a conflict that 1) is
>> not of his making and 2) has already been resolved by someone else.
>
> Hmm, I might want some data from you.. I've been recently formulating
> some ideas about how to be smarter (or at least more consistent) when
> picking the merge ancestor.
>
> Does your workflow regularly involve backouts or bidirectional merging
> between branches?
>
>> One workaround for this annoyance is to add an --ancestor option to
>> the merge command. Martin posted an implementation of this on
>> stackoverflow recently, and we're going to steal his code and add it
>> our local "hacks" extension. (Thanks Martin!)
>
> Link?

It's here, along with an example of a criss-cross merge that gives
different output depending on the ancestor you pick:

  http://stackoverflow.com/a/9430810/110204

I just let 'hg merge' pass an revision to merge.update, really simple.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120313/f5bc3450/attachment.pgp>


More information about the Mercurial-devel mailing list