filemerge: add a before-merge callback to internal merge tools
authorSiddharth Agarwal <sid0@fb.com>
Tue, 06 Oct 2015 22:54:14 -0700
changeset 26513 01224c28e0ed
parent 26512 4c52dd406adc
child 26514 d5d8cd0e0d58
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.
mercurial/filemerge.py
--- 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