Anyone know how integrate ExamDiff with Mercurial? I have KDiff3 set up but couldn't figure out how to set up ExamDiff.
Update: Per accepted answer, this .hgrc config worked:
[extensions]
hgext.extdiff =
[extdiff]
cmd.examdiff = C:\Program Files\ExamDiff Pro\ExamDiff.exe
Can run ExamDiff with the comand hg examdiff
This can be done with the Extdiff extension.
Related
Mercurial can be configured using a mercurial.ini (or .hgrc) file. In the [ui] section (docs) there is a merge option.
This option is only documented as follows:
merge
The conflict resolution program to use during a manual merge.
In my current configuration I just have the line:
merge = kdiff3
But what is the allowed syntax for this setting? For instance, can I provide command line options to the specified program? Can I use an absolute path? etc.
Thanks
Note - the above cited docs do suggest looking in another link for more related information (https://www.selenic.com/mercurial/hg.1.html#merge-tools) but this does not specifically cover the configuration section I am interested in.
The approach isn't to add options to the [ui]\merge entry but instead to further configure the merge tool elsewhere.
The page on kdiff3 in the mercurial wiki is more elaborate on how you can configure kdiff3 with mercurial by using the [extdiff] and [merge-tools] sections. Excerpt:
[extensions]
hgext.extdiff =
[extdiff]
cmd.kdiff3 =
[merge-tools]
kdiff3.args = $base $local $other -o $output
That will add a new graphical diff command hg kdiff3 (using ExtdiffExtension), and tells Mercurial to use kdiff3 for merges.
Is there any way to use WebStorm diff tool with TortoiseHg?
I've tried to set vdiff = /usr/local/bin/wstorm in .hgrc, but it didn't help.
You must perform more jobs, if you want to use external diff with Extdiff extension
Now custom diff tool can be added to Mercurial without this extension: read [merge-tools] section in MergeTools.rc for any merge-tool, but note only *diff keys, namely diffargs, diff3args, dirdiff
Enable invocation of WebStorm operations from the command line as instructed here (so that you can execute webstorm from the Terminal).
Put the followings to your .hgrc file:
[extensions]
extdiff =
[extdiff]
cmd.wsdiff = webstorm
opts.wsdiff = diff
(bonus) Make WebStorm as your default merge tool:
[ui]
merge = webstorm
[merge-tools]
webstorm.check = prompt
webstorm.args = merge $local $other $base $output
I can't figure out why my extdiff extension is not working for Mercurial (on a Mac).
this is what my .hgrc file looks like:
[extensions]
fetch=
hgext.extdiff =
[extdiff]
cmd.kdiff3 =
[ui]
merge=kdiff3
[merge-tools]
kdiff3.executable=/Applications/kdiff3.app/Contents/MacOS/kdiff3
kdiff3.args = $base $local $other -o $output
and yet kdiff3 is recognized as a merge tool.. and can be run from the cmd line like "kdiff3". but what i'd like to do is use kdiff3 as a gui tool for comparing diff files.
like this:
hg extdiff -p kdiff3
this seems like the best way of using kdiff3 as a popup gui when using Mercurial.
I am new to this and am not sure if I am doing it right.
Thanks...!
By the way, when I try to run 'hg extdiff'
I get:
hg: unknown command 'extdiff'
'extdiff' is provided by the following extension:
extdiff command to allow external programs to compare revisions
use "hg help extensions" for information on enabling extensions
(even though it is in .hgrc)
Please note that merge-tool and external diff are different tools for different tasks.
For example you can use fmdiff script to use FileMerge for diff and k3diff for merge-tool:
Your .hgrc should be:
[extensions]
# enable external diff program
extdiff =
[extdiff]
cmd.opendiff = fmdiff
opts.opendiff =
[merge-tools]
# Override stock tool location
kdiff3.executable = /Applications/kdiff3.app/Contents/MacOS/kdiff3
# Specify command line
kdiff3.args = $base $local $other -o $output
# Give higher priority
kdiff3.priority = 1
Now you can use
hg opendiff myfile.ext
Please note that 'opendiff' is a custom wrapper name, so you can change it to your likes but it cannot be one of already reserver names.
I use mercurial and I want to see modified change in Vim or GVim.
Normally there is hg diff which show the modified changes in diff format.
but I want to see it in Vim as the original version and modified version side-by-side.
I try extdiff in ExtdiffExtension but it doesn't work and gvim open some blank file.
I know there is gvim -d localfile otherfile but I don't know how to config mercurial.
If you're fine with vim, I'm been using this in my ~/.hgrc for months without problems
[extensions]
hgext.extdiff =
[extdiff]
cmd.vimdiff =
[alias]
vi = vimdiff
vim = vimdiff
Then you just use
hg vimdiff somefile
The [alias] section is optional, but it's nice to have.
I'm using v1.4.2, FWIW.
Check this: Using vimdiff to view single diffs
hg cat <filename> | vim - -c ":vert diffsplit <filename>" -c "map q :qa!<CR>";
I can't help you for the vim part, but in mercurial, to get the content of a file in the parent changest, you'll do hg cat path/to/my/file.ext
On OSX when using MacVim (and homebrew):
cd /usr/local/bin
ln -s mvim gvimdiff
edit~/.hgrc
[extdiff]
cmd.gdiff = gvimdiff
opts.gdiff = -f
then to use:
hg gdiff somefile.cpp
I am trying to set up WinMerge as the Merge tool into TortoiseHG;
Here is my Mercurial.ini:
; User specific Mercurial config file.
; See the hgrc man page for details.
[ui]
username = Bargio <>
merge = winmergeu
[extdiff]
cmd.winmerge = C:\Program Files (x86)\WinMerge\WinMergeU.exe
opts.winmerge = /e /x /ub /wl
[merge-tools]
winmergeu.executable = C:\Program Files (x86)\WinMerge\WinMergeU.exe
winmergeu.priority= 1
winmergeu.fixeol=True
winmergeu.checkchanged=True
winmergeu.args= /e /ub /dl other /dr local $other $local $output
winmergeu.gui=False
[tortoisehg]
vdiff = winmerge
Visual diff works perfectly but when I try to merge two files, I get the following error:
tool winmergeu can't handle binary
How can I fix it?
You no longer have to mess with the .ini file. As long as you have both TortoiseHG and WinMerge installed you will see it as an option in TortoiseHG Global Settings - TortoiseHG section - Three-way Merge Tool and Visual Diff Tool. It shows up as "winmergeu". Banged my head against the wall for a couple hours before I found this; I must be blind.
WinMerge 2.12.4.0 Unicode
TortoiseHg 2.5.1
Mercurial 2.3.2
You can add
winmergeu.binary=True
as found here if winmerge can merge binary files. If it can't you'll want to configure another merge tool that can and use matters to send the binary files to that tool.