How to use ExtDiff extension of Mercurial

Mercurial is very convenient to use at the commandline. However, there are certain operations that are better with the GUI. For example, I prefer to use a GUI to go through the diff of uncommitted changes. The ExtDiff extension can be used to launch a GUI Diff tool to view the diff of a single file or across the entire repository.

  • To enable the ExtDiff extension, add this line to your hgrc:
[extensions]
hgext.extdiff =
  • To view the diff of a particular file using a GUI diff program, for example meld:
$ hg extdiff -p meld src/bar/foo.cpp
  • To view the diff of all uncommitted files using a GUI diff program, for example meld:
$ hg extdiff -p meld

Make sure that the GUI diff program you use has the ability to show the diff of multiple files in a directory hierarchy.

  • If you want to always launch a particular GUI diff program, then it is better to add a custom command for it. For example, to launch meld using a new command named vdiff, add this line to your hgrc:
[extdiff]
cmd.vdiff = meld

After this, you can view the diff using the vdiff command:

$ hg vdiff src/bar/foo.cpp
$ hg vdiff

Tried with: Mercurial 2.8.2 and Ubuntu 12.04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.