changeset 26513:01224c28e0ed

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.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 06 Oct 2015 22:54:14 -0700
parents 4c52dd406adc
children d5d8cd0e0d58
files mercurial/filemerge.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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