Thursday, February 11, 2010

xxdiff with mercurial and git, hg view with mercurial

Enabling xxdiff with mercurial

You can link xxdiff into mercurial, but you have to modify the hgrc file

add to: $HOME/.hgrc

[extensions]
hgext.extdiff =

and then we can say

hg extdiff -p program -o options

e.g.

$ hg extdiff -p xxdiff -o -r

which causes xxdiff -r to run

or

 
$ hg extdiff -p kdiff3

We can be even more subtle by adding an explicit command for xxdiff -r

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

which allows us to use

$ hg xxdiff

to call xxdiff directly in its recursive mode.


xxdiff with git

For me,

$ git difftool

Runs xxdiff automatically, but file by file, which is not as good.
I don't know if that's the default, or whether I configured it accidentally whilst trying various ways to add it.



Enabling hg view

While we're messing about with .hgrc, add

[extensions]
hgext.extdiff=
hgk=

which will enable the hg view command.

No comments:

Post a Comment