Thanks to the endless efforts of one of the most polite user here on stack exchange, I finally figured out that the mercurial wiki seems to be outdated. There it says:
Add to ~/.hgrc:
[extensions]
hgext.extdiff =
[extdiff]
cmd.kdiff3 =
[merge-tools]
kdiff3.args = $base $local $other -o $output
The extdiff extension is not needed, as I don't want to define a new hg kdiff3
command here.
But Mercurial has some more settings for the merge tool:
[ui]
merge = kdiff3
Regarding to the Mercurial help on merge tools, the ui.merge
setting should not be necessary, as I specifically set a merge-tools configuration:
Mercurial uses these rules when deciding which merge tool to use:
- If a tool has been specified with the --tool option to merge or resolve, it is used. If it is the name of a tool in the merge-tools
configuration, its configuration is used. Otherwise the specified tool
must be executable by the shell.
- If the "HGMERGE" environment variable is present, its value is used and must be executable by the shell.
- If the filename of the file to be merged matches any of the patterns in the merge-patterns configuration section, the first usable
merge tool corresponding to a matching pattern is used. Here, binary
capabilities of the merge tool are not considered.
- If ui.merge is set it will be considered next. If the value is not the name of a configured tool, the specified value is used and must be
executable by the shell. Otherwise the named tool is used if it is
usable.
- If any usable merge tools are present in the merge-tools configuration section, the one with the highest priority is used.
- If a program named "hgmerge" can be found on the system, it is used - but it will by default not be used for symlinks and binary
files.
- If the file to be merged is not binary and is not a symlink, then internal ":merge" is used.
- The merge of the file fails and must be resolved before commit.
I somehow have the feeling that Mercurial changed it's behavior here (or some other part of my system), because on all machines where I used kdiff3 I don't have the last setting in my .hgrc. However, adding ui.merge
does the trick.