commit merge automatically if it resolves cleanly

Issue #22 open
Wolfgang Schnerring
created an issue

When "hg pull --rebaseif" needs to do a merge instead of a rebase, it always leaves it up to the user to commit that merge, even when it resolved cleanly automatically. This is a little annyoing, since when rebaseif ends with a merge, I always end up doing "hg resolve -l", "oh, everything's resolved already", "hg ci -m 'Merge upstream'". That's what computers are for, aren't they? ;-)

The stock "hg fetch" extension (which does pull+merge) automatically commits the merge if there are no conflicts. It would be handy if rebaseif did the same, i.e. attempt to rebase, if that fails to go cleanly, do a merge -- but if that works cleanly, commit it automatically.

Comments (5)

  1. Wolfgang Schnerring reporter

    I'm willing to work on this, but I have no expertise of Mercurial or its extensions, so I guess I'd end up copying most of the "fetch" command wholesale -- so, any directions would be appreciated.

  2. Marcus Lindblom Sonestedt repo owner

    Sounds fine, if it´s optional. (i.e. add a flag to enable this behaviour, then if you want it by default, just add it to the [defaults] section in your global .hgrc)

    Also, ripping the relevant parts (i.e. everything after pull) from fetch should be ok too, I suppose. I don't know much more than you, since I ripped the rebase command to make rebaseif. :)

    Submit a pull request once you're done, and I'll merge it.

  3. Log in to comment