Question about internal:fail

Greg Ward greg-hg at gerg.ca
Thu Dec 1 01:37:18 UTC 2011


On Wed, Nov 30, 2011 at 12:47 PM, Mike Meyer <mwm at mired.org> wrote:
>> > The scenario I want happens *every time I merge*. That is *not*
>> > "pretty rare". If it were, it wouldn't be an issue.
>> It doesn't happen for most other people so... use another revision
>> control system, then.
>
> Sure. Can you suggest a DVCS that provides good control during a
> merge?  I haven't found one, which leaves me writing one.
>
> It'd be easier to fork mercurial.

And even easier to implement the feature you want, which is some
control over the manifest merge. It's right there in
mercurial/merge.py: manifestmerge().

I think Sune was a bit over-the-top in suggesting "get another version
control system". Mercurial's not 100% perfect, but it's pretty darn
good. If you do something about this problem, then it'll edge a little
closer to perfect.

Idea #1: write an extension that overrides manifestmerge() with your
preferred "pick local" or "pick other" semantics. As a baby-steps
exercise, you could do one extension that implements "pick local" and
another that implements "pick other". Then you'd have to enable one
extension or the other every time you merge, depending on the
behaviour you want. Then you need to figure out how to unify them
(easy) and expose a knob to the user letting them specify which
manifest merge algorithm they want (not so easy, given the variety of
places where Mercurial invokes merge).

Idea #2: write it as a patch to core Mercurial. It's a lot more work
to get it accepted, but if it does get in then *poof* the entire
community benefits in the next release. I would start with an
extension, because it gives you more freedom to do crazy stuff, change
your mind, break things, etc. But if it really takes off, it might be
a sensible core feature.

BTW, I'm curious about why you always need a "pick local" or "pick
other" merge strategy. That's ... umm ... not really *merging* then,
is it? I mean, if you always overrule the work done on one branch with
the other branch, then why bother merging them? Why even bother
implementing both?

Greg



More information about the Mercurial mailing list