Fixes #22: Add ability to automatically commit the merge if it resolved cleanly

#5 Open

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update default
hg pull -r default
hg merge 465505a59527
hg commit -m 'Merged in wosc/ml-hgext (pull request #5)'
  1. Wolfgang Schnerring

Alright, here's my stab at this. It started pretty much as expected, I've ripped the part about committing the merge from the fetch extension. And I've made it configurable, so you need to set this to enable it:

rebaseif-commit-merge = True

But then I hit a snag concerning "hg pull --rebaseif": Since we want to do a commit in the rebaseif part, we need commit options (like user and date), which "hg pull" doesn't have. So we can't keep the interface of "hg pull --rebaseif", which simply wraps "hg pull", but need a specialized command instead, which can declare its own options. I've chosen "hg fetch", since what we're doing is like the fetch extension, only better (due to rebase).

Since I set up an alias "fetch = pull --rebaseif" first thing after installing the extension, I'm personally not too worried about breaking the former interface -- but I'm not sure what you think about this whole enterprise now. ;)

Comments (1)

  1. Marcus Lindblom Sonestedt repo owner

    Sorry for taking so long to look at this. I haven't had time to give my hg-extensions any love. (Also, I'm not using them at work anywore)

    But, well. I think your idea is sound.

    I don't like the nameclash with the existing fetch-extension, since you might have both installed. (different use-cases for different repos, perhaps). I think it should be called something different (rebaseif, or better) then people can alias that instead.

    Other than that, since there are no tests, I take it on faith that this works as expected?