[PATCH V2] merge: Add support for 'union' merge strategy

Erik Huelsmann ehuels at gmail.com
Sat Aug 15 21:38:26 UTC 2015


On Sat, Jul 11, 2015 at 1:25 AM, Matt Mackall <mpm at selenic.com> wrote:

> On Fri, 2015-07-10 at 20:10 +0200, Erik Huelsmann wrote:
> > # HG changeset patch
> > # User Erik Huelsmann <ehuels at gmail.com>
> > # Date 1435346089 -7200
> > #      Fri Jun 26 21:14:49 2015 +0200
> > # Node ID c8b0c9fb18ec813244b100e7ecf9ee5eb7b92f88
> > # Parent  ff5172c830022b64cc5bd1bae36b2276e9dc6e5d
> > merge: add support for 'union' merge strategy to internal merge tool.
> >
> > 'union' merge is a merge strategy where the left and right side of a
> > conflicting merge are merged into the target without generating a
> conflict.
> >
> > One use-case for this merge strategy is the Changelog file being changed
> > on multiple branches and conflicting when being merged back to the main
> > branch.
> >
> > The idea for this merge strategy has been taken from Git.
>
> This looks ok, but it's a bit much going on in one patch by our
> standards. Could I get you to split it up into the following pieces:
>
> - bits that add start/end_marker (but please, no _ in new names)
> - bits that union option to simplemerge
> - bits that split out filemerge helper function
> - bits that add union merge + test of same
>
> Also, we may want the start/end marker business to be fully internal to
> simplemerge rather than passing in more args.
>

Ok. But the labels were always external from simple merge already. Even
worse(?): filemerge offers the lables to its callers to set. Do you want me
to look at options to make the labels internal to simple merge?

Note that the labels are *not* the usual ">>>>>", "=======" and "<<<<<<"
labels, but they are text to be added *after* the labels. E.g. "local",
"other", etc. I wouldn't directly know how to keep that local, so I'll have
to look at it. There's a new 'mode' keyword arg which, if present with a
value of 'union', suppresses the markers. The suppression happens inside of
simplemerge. Would that satisfy your "start/end marker business fully
internal to simplemerge"?

With respect to the remark of the underscores: I wasn't creating new ones
(I think), but simply re-using variable names that were already used in the
file. I assumed I could use existing variables with underscores.


Thanks for your further guidance!

-- 
Bye,

Erik.

http://efficito.com -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150815/32abca94/attachment.html>


More information about the Mercurial-devel mailing list