I'm using the Mercurial distributed version control system, and I'm wondering how I can configure it to use WinMerge instead of its own internal diff tool. I've already got WinMerge as the merge tool, but I want Mercurial to use WinMerge when I type:

hg diff

Is there any way of doing that, or am I stuck with Mercurial's internal diff tool?

Now run the Global Settings tool. On the TortoiseHg tab, you should see winmerge available in the drop-down list for Visual Diff Command. Select winmerge, apply, then close.

This same approach can be used to add nearly any visual diff tool, but be aware that your diff tool must be able to support directory diffs if it is to be used by TortoiseHg, unless you are using release 0.8 or later.

Joel also provided a solution here in case you run Mercurial under Cygwin.

I'm not using TortoiseHG, nor am I running Mercurial under Cygwin. I'm using the default command line Mercurial installer from mercurial.berkwood.com. Your solution worked, in the sense that I'm able to type 'hg winmerge <file>' to see the diff between it and the previous version, but 'hg diff <file>' still brings up the same (rather ugly) diff tool. Still, its better than nothing.
–
quanticleAug 17 '09 at 15:31

I think this answer assumes that you will edit Mercurial.ini in the TortoiseHg directory (eg C:\Program Files\TortoiseHg). If you edit the one in the Mercurial directory (eg C:\Program Files\Mercurial) then this won't work (at least it didn't for me).
–
Ashley DavisNov 16 '09 at 18:15

I find it useful to run winmerge in the background so I can look at changes while setting the commit message and also display stats on what files have change on the command line. To do this put a batch file in the mercurial directory that contains start /b hg winmerge<NEWLINE> hg diff --stat
–
danioJun 18 '10 at 9:51

Well, the answers given earlier doesn't give me desired effects. They doesn't allow to make revisions diff and in place edit(I mean the same functionality which is available for TortoiseSVN from the box). To do that I've added additionally to mercurial.ini this section: