Can I change the default comparison tool in Mercurial?

Every time I do "hg diff file.ext", I end up using the diff console application. Is there any way to change this? I cannot find the link in the Mercurial documentation ( I'm not talking about merging! ). I would like to use Kdiff3 or WinMerge (I use Windows).

+58
mercurial diff configuration
Oct 26 '08 at 16:14
source share
4 answers

I solved this with the built-in Mercurial extension ... I just need to add the following lines to Mercurial.ini (in the Mercurial folder):

[extensions] hgext.extdiff= [extdiff] cmd.vdiff = kdiff3 

When I want to use kdiff3 instead of diff, I only need to use:

 hg vdiff file.ext 
+66
Oct 27 '08 at 18:45
source share

Using this configuration

 [extdiff] cmd.kdiff3 = 

I use this command to see diffs:

 hg kdiff 

Shows a directory tree with all modified files. You click on the file to see diff for the file only. You can add a file parameter to a command to see only one file.

More details here .

+8
Sep 18 '09 at 14:53
source share

I had this problem a few minutes ago; I just installed it and added my path (by default in c: \ program files \ kdiff3) to my PATH ev system. I reloaded my window to pick up a new path and "hg kdiff3" just worked. As it turned out, my base file "mercurial.ini" contains the following: this allows kdiff3 to work for all hg repositories in the system.

 [extensions] hgext.extdiff = [extdiff] cmd.kdiff3 = [merge-tools] kdiff3.args = $base $local $other -o $output 
+2
Dec 23 '10 at 17:13
source share

If you are looking for something like git difftool where you do not need to enter file names and see diff for all modified files, add them to ~/.hgrc and run hg difftool .

 [extensions] extdiff = [extdiff] cmd.vimdiff = vimdiff [alias] difftool = !for file in $(hg status -n); do hg vimdiff $file; done 
0
Sep 07 '16 at 13:24
source share



All Articles