I use ediff to merge mercurial conflicts (and sometimes git conflicts), but I can't seem to abort. Ediff pops up as soon as a conflict is detected, and quitting and not saving results in mercurial accepting the existing version and drops the commit, saying the destination already has the changes.

I can't seem to suspend and abort the commit because the rebase/merge already has a lock.

What is the workflow for safely aborting a merge, restoring the previous state as though a merge/rebase was never attempted. To be clear, I'm not sure if this is a mercurial/git question or an ediff question.

1 Answer 1


It has noting to do with Emacs which works as a simple text editor in this case. If you want to abort merge, don't edit/save any file. Just abort text editor and hg/git will ask you do you want to abort merge. Say yes.

I assume your mercurial setup is same as https://www.mercurial-scm.org/wiki/MergingWithEmacs

  • When I quit emacs without making modifications I get the behavior where the rebase completes destructively, or moves onto the next file, without asking me if I'd like to abort. Tangential to this issue is that in some cases there are many files, and I don't see a way to abort them all at once. Dec 10, 2019 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.