changeset 1878:c44f161575ba

compat: adapt to change in mercurial core The code around merge destination have been changed in core, we do some basic adaptation to make sure we don't crash. Further rework to adapt//take advantage of core change would probably be useful but this is not the point of this commit.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 12 Mar 2016 12:36:25 +0000
parents 69077c65919d
children bd5c2922a8ad
files src/topic/destination.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/topic/destination.py	Thu Dec 31 11:23:19 2015 -0500
+++ b/src/topic/destination.py	Sat Mar 12 12:36:25 2016 +0000
@@ -4,7 +4,7 @@
 from mercurial import extensions
 from mercurial.i18n import _
 
-def _destmergebranch(orig, repo):
+def _destmergebranch(orig, repo, action='merge', sourceset=None, onheadcheck=True):
     p1 = repo['.']
     top = p1.topic()
     if top:
@@ -37,7 +37,10 @@
                               % (top, len(heads)))
         else:
             assert False # that's impossible
-    return orig(repo)
+    if orig.func_default: # version above hg-3.7
+        return orig(repo, action, sourceset, onheadcheck)
+    else:
+        return orig(repo)
 
 def setupdest():
     if util.safehasattr(destutil, '_destmergebranch'):