Given a custom hg merge tool mymergetool.py
On Linux, I can do this:
merge-tools.MyMergeTool.executable=mymergetool.py
which runs the python in a new process.
However on Windows one has to specify python.exe as the executable. But given that one might not exist on the system (I use hg embedded in an application)
I would like to be able to do something like this:
merge-tools.MyMergeTool.executable=python:mymergetool.py
which runs the merge tool in the same process as hg.
However when reading hg's filemerge.py
it seems that the python:
prepend isn't supported in this context.
Is there any other way of providing a custom merge tool that can run in process? (eg. using hooks or extensions)
This is now possible in Mercurial 4.7 and newer. MergeTool configuration documentation
One specifies a python file along with a python function.
merge-tools.MyMergeTool.executable=python:mymergetool.py:mergefn
The function signature is this:
def mergefn(ui, repo, args, **kwargs):