Conflict resolution using Emacs

Stefan Monnier monnier at iro.umontreal.ca
Fri Jan 27 17:11:02 UTC 2012


> visit the file and notice that smerge-mode is enabled.  There are then
> keybindings that let you move forward and backward through the conflicting
> sections, and choose which (or both) region to keep.  There are some other
> interesting keybindings, although all are a little hard to reach.  Just C-h m
> when you visit a conflicting file and search the help for 'smerge' for
> details.

There's also an `SMerge' menu.  As for the key-bindings, they're indeed
rather inconvenient.  I personally (setq smerge-command-prefix "\e") so
I can use M-n, M-p, M-RET instead of C-x ^ n, C-x ^ p, ...
Also I recommend you use "bzr merge/pull/update --show-base" so your
conflict markers include the ancestor information, which can be
tremendously helpful in resolving conflicts.

> I have noticed though that smerge-mode doesn't work well with Mercurial, but
> who cares about that? :)

Assuming Mercurial can generate standard conflict markers (which sadly
is anything but obvious: it seems like conflict markers are one of
those things for which every VCS likes to redefine its own format), it
should be easy to fix, so please M-x report-emacs-bug.


        Stefan




More information about the bazaar mailing list