compat: adapt to change in mercurial core
authorPierre-Yves David <pierre-yves.david@fb.com>
Sat, 12 Mar 2016 12:36:25 +0000
changeset 1878 c44f161575ba
parent 1877 69077c65919d
child 1879 bd5c2922a8ad
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.
src/topic/destination.py
--- 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'):