
- #Using diffmerge with tortoisesvn install
- #Using diffmerge with tortoisesvn full
- #Using diffmerge with tortoisesvn portable
- #Using diffmerge with tortoisesvn windows
'"cygpath -w %2"' ) do set TMergePath2=%%A '"cygpath -w %1"' ) do set TMergePath1=%%A In order to get it to TortoiseMerge to work with Cygwin's version of Mercurial try this: off

"%TMergePath%" /base:%2 /mine:%1 /theirs:%3 /merged:%1Įcho hgmerge: cannot find TortoiseMerge location in the registry. If "%TMergePath%"="" (goto :notfound) else (goto :tortoisemerge) '"reg query "HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseSVN" /v TMergePath 2> nul"' ) do set TMergePath=%%B :: Look in the registry for TortoiseMerge location "C:\Program Files\KDiff3\kdiff3.exe" -auto -L1 Base -L2 Local -元 Other %2 %1 %3 -o %1Įxample script for Tortoise Merge (works with XP and later versions): off
#Using diffmerge with tortoisesvn full
Until someone fix the script to determine path correctly in such case, we may just hardcode full kdiff3 path in the script instead of querying off For example I have kdiff3 installed in C:\Program Files\KDiff3\. Note: this script has problems when whitespace present in kdiff3 path. If %errorlevel% neq 0 (exit 1) else (exit 0)Įcho hgmerge: cannot find KDiff3 location in the registry. If "%KDiff3Path%"="" (goto :notfound) else (goto :kdiff3) '"reg query "HKEY_CURRENT_USER\SOFTWARE\KDiff3" /ve 2> nul"' ) do set KDiff3Path=%%B :: Look in the registry for KDiff3 location If you really want to call this script, use "cmd /c hgmerge" or "start hgmerge".Įxample script for KDiff3 (works with XP and later off This is necessary to make hg detect failed merges. The scripts are not intended for the user: If you call them directly they will exit your command prompt. Note that you must create something, as no hgmerge script is currently provided on Windows. In this case do not set the merge entry in the ui section of your hgrc file.
#Using diffmerge with tortoisesvn windows
On Windows you can create a batch file called hgmerge.cmd which is located somewhere in the path, e.g. It also assumes you've saved the hgmerge.py file to c:\Mercurial\. See above for links to obtain various merge programs like kdiff3 or diff3. Windows c:\Documents and Settings\USERNAME\Mercurial.ini or %HOME%\Mercurial.ini exampleįor this to work, the programs python.exe, kdiff3.exe, and diff3.exe are assumed to be on your PATH.

#Using diffmerge with tortoisesvn install
If you have no python interpreter, then either install one or else you might be interested in trying the more user-friendly front end to Hg, TortoiseHg instead. On Windows, you will have to specify merge = python \path\to\hgmerge.py in the of your Mercurial.ini, presuming you have a python interpreter installed on your computer. To use this merge script on a *nix system, simply copy the script somewhere in your path, make it executable, then add these lines to your ~/.hgrc:Ĭonfiguration of the script is now documented separately. On Windows, the script will even look in the registry for tools which are installed but not in the system path (Note: registry searching requires the pywin32 package).
#Using diffmerge with tortoisesvn portable
Since it's written in python it is portable to all the platforms that run Mercurial. There is a python based merge script available which will detect the merge tools you have available on your computer and use them appropriately (similar to the hgmerge shell script which is packaged with Mercurial). Note that the order of the argument can differ between hg and your merge program, hgmerge is called hgmerge local base otherįor example kdiff3 is called kdiff3 base local other -o output If it cannot find any of them, hgmerge runs a text editor on a version of the file with the conflicts annotated. The hgmerge script tries to invoke several merge programs in turn. See MergeToolConfiguration for the new mechanism. As of Mercurial 1.0, hgmerge is no longer installed (and it should not be distributed with Mercurial), but hg still uses it, if it's present on the system and no other merge tools are configured. This page describes Mercurial 0.9.5 and older releases and is no longer relevant for Mercurial 1.0īefore Mercurial 1.0, a script named hgmerge was installed by default.
