filemerge: add a before-merge callback to internal merge tools
We're going to separate the pre-merge and merge steps for merge tools. The
merge step will be specific to the tool, but the pre-merge step will be common
to all merge tools that need it.
However, some merge tools run checks *before* the pre-merge step. This callback
will allow that to continue to work.
--- a/mercurial/filemerge.py Tue Oct 06 17:39:13 2015 -0700
+++ b/mercurial/filemerge.py Tue Oct 06 22:54:14 2015 -0700
@@ -38,7 +38,7 @@
# Merge tools to document.
internalsdoc = {}
-def internaltool(name, trymerge, onfailure=None):
+def internaltool(name, trymerge, onfailure=None, precheck=None):
'''return a decorator for populating internal merge tool table'''
def decorator(func):
fullname = ':' + name
@@ -48,6 +48,7 @@
internalsdoc[fullname] = func
func.trymerge = trymerge
func.onfailure = onfailure
+ func.precheck = precheck
return func
return decorator