compat: adapt to the new destspace argument of destmerge
The argument is currently ignored in the topic case for simplicity, but we
properly accept it and propagate it to the original function to prevent crash
and behavior regression in the non-topic case.
--- a/hgext3rd/topic/destination.py Mon Apr 04 00:28:03 2016 -0700
+++ b/hgext3rd/topic/destination.py Wed May 11 16:06:58 2016 +0200
@@ -9,7 +9,8 @@
util,
)
-def _destmergebranch(orig, repo, action='merge', sourceset=None, onheadcheck=True):
+def _destmergebranch(orig, repo, action='merge', sourceset=None,
+ onheadcheck=True, destspace=None):
p1 = repo['.']
top = p1.topic()
if top:
@@ -42,8 +43,10 @@
% (top, len(heads)))
else:
assert False # that's impossible
- if getattr(orig, 'func_default', ()): # version above hg-3.7
+ if len(getattr(orig, 'func_defaults', ())) == 3: # version hg-3.7
return orig(repo, action, sourceset, onheadcheck)
+ if 3 < len(getattr(orig, 'func_defaults', ())): # version hg-3.8 and above
+ return orig(repo, action, sourceset, onheadcheck, destspace=destspace)
else:
return orig(repo)