How do I use tortoisegitmerge with mercurial?

249 views Asked by At

I'm using mercurial for revision control in Windows, but I'd like to use a nice merge tool like TortoiseGitMerge. How can I tell Mercurial to use TortoiseGitMerge for merge conflicts?

2

There are 2 answers

0
Lazy Badger On

Good [merge-tools] section for TortoiseGitMerge (extracted from TortoiseHG's hgrc.d\MergeTools.rc) for single merge-tool only (Merge Tool Configuration wiki-page used for reference)

tortoisegitmerge.args=/base:$base /mine:$local /theirs:$other /merged:$output
tortoisegitmerge.regkey=Software\TortoiseGit
tortoisegitmerge.regkeyalt=Software\Wow6432Node\TortoiseGit
tortoisegitmerge.regname=TMergePath
tortoisegitmerge.checkchanged=True
tortoisegitmerge.gui=True

For more than 1 merge tool tortoisegitmerge.priority key with some priority have to added. In order to ignore priority-list and use always preselected from possible choices merge-tool, use

[ui]
merge = tortoisegitmerge

In global or repository-specific ini-file

2
Josh Kodroff On

Ensure that you have installed TortoiseGit.

Then, edit or create %userprofile%\.hgrc (e.g. c:\users\YOUR_USER_NAME\.hgrc) and add the following:

[extdiff]
cmd.tortoisegitmerge = c:/Program Files/TortoiseGIT/bin/TortoiseGitMerge.exe

[merge-tools]
tortoisegitmerge.args = -base $base -mine $local -theirs $other -merged $output