xxdiff with mercurial

Martin Blais blais at furius.ca
Mon Feb 11 15:40:07 CST 2008


Hello Mercurial devs,

I'm the author of xxdiff. I have switched to using Mercurial
for some of my projects and I absolutely adore it. I have
thus written a small Python wrapper script to set as the
program to be run to resolve conflicts when merging. The
script is called xx-hg-merge and can be found in the latest
xxdiff snapshot, it behaves the way the Mercurial expects
the graphical merge program to work (exit status, stores the
result in the left filename). In addition, it invokes xxdiff
in decision mode, and this case is exactly what decision
mode was built to handle (you press "A" to accept the
changes, "R" to reject them, and "M" to accept the
selections).  Note that you will need to install xxdiff
Python libs in order to use it (xxdiff comes with support to
invoke it in various ways.)

Below is an excerpt from the xxdiff documentation that
explains how to setup a user's .hgrc to use my tool to do
merging. I'm sure there are other extensions, if anyone
knows how to do this better, please reply.

Any comments appreciated. Thanks for making Mercurial!


  xxdiff already works pretty well with Mercurial for
  viewing differences, all you have to do is to add the
  following to your ``.hgrc`` file to view diffs
  graphically::

    [extensions]
    extdiff =

    [extdiff]
    cmd.xdiff = xxdiff
    opts.xdiff = -r

  However, graphical conflict resolution during merging
  requires a wrapper script that will invoke xxdiff in
  decision mode and that will automatically save the merge
  results where Mercurial expects them. The script is
  called ``xx-hg-merge``, and you will need to add the
  following to your ``.hgrc``::

    [ui]
    merge = xx-hg-merge





More information about the Mercurial mailing list