[ANN] python based merge scripts
Steve Borho
steve at borho.org
Sun Sep 23 21:45:14 CDT 2007
Hi folks,
I've been working on the python based hgmerge scripts that Arve Knudsen
posted to the bts some months ago. The effort had been centered around
the Windows installers in the hopes of cleaning up the rough edges of
working with external merge tools, but they now have progressed far
enough to split them out of the hg-nsi repository. To use these scripts
you simply copy them somewhere and then add a line to your hgrc:
[ui]
merge = python /path/to/hgmerge.py
hgmerge.py looks for the Wrappers/ subdirectory to be in its own
directory, so keep them bundled together as they are in the repo.
Features:
* Automatic detection of non-interactive (diff3, merge) merge tools
and interactive (kdiff3, meld, etc) merge tools. If a non-interactive
tool is found, it will be used first to perform trivial merges. If the
non-interactive tool fails, it falls back to the interactive tool.
* On Windows, it can search the registry to find tools that are
installed but not in the system path (Kdiff3, TortiseMerge, P4Merge).
If the registry check fails, it falls back to a path search
* It has wrappers for (g)diff3, merge, kdiff3, meld, gpyfm,
TortoiseMerge, P4Merge, and tkdiff (contributions welcome). Where
possible I followed the logic of the hgmerge shell script that ships
with Mercurial.
* The wrapper scripts use a common library to detect incompatible EOL
types and either workaround them (kdiff3) or fail gracefully (tkdiff).
* The user can set $HGMERGE_TOOL to override the autodetection
Since kdiff3 has an '--auto' option, it is considered both
non-interactive and interactive. On Windows, it's likely the only
non-interactive tool you'll have.
The scripts have been tested on Windows and Linux, and should be well
suited to both platforms. They should run on MacOS as well, but I have
no Macs to try them on.
PS: http://hg.borho.org/hgmerge
--
Steve Borho
More information about the Mercurial
mailing list