hgext/simple4server.py
branchstable
changeset 1253 d03583da89c4
parent 1252 d001376b0c09
child 1257 c52c15100fb2
--- a/hgext/simple4server.py	Sat Apr 11 10:35:26 2015 -0400
+++ b/hgext/simple4server.py	Mon Apr 20 13:36:12 2015 +0200
@@ -255,10 +255,13 @@
         caps += ' _evoext_getbundle_obscommon'
     return caps
 
-def _getbundleobsmarkerpart(orig, bundler, repo, source, heads=None, common=None,
-                            bundlecaps=None, **kwargs):
+def _getbundleobsmarkerpart(orig, bundler, repo, source, **kwargs):
     if 'evo_obscommon' not in kwargs:
-        return orig(bundler, repo, source, heads, common, bundlecaps, **kwargs)
+        return orig(bundler, repo, source, **kwargs)
+
+    heads = kwargs.get('heads')
+    if 'evo_obscommon' not in kwargs:
+        return orig(bundler, repo, source, **kwargs)
 
     if kwargs.get('obsmarkers', False):
         if heads is None:
@@ -284,6 +287,10 @@
     wireproto.commands['evoext_pullobsmarkers_0'] = (srv_pullobsmarkers, '*')
     # wrap module content
     extensions.wrapfunction(exchange, '_pullbundle2extraprepare', _getbundleobsmarkerpart)
+    origfunc = exchange.getbundle2partsmapping['obsmarkers']
+    def newfunc(*args, **kwargs):
+        return _getbundleobsmarkerpart(origfunc, *args, **kwargs)
+    exchange.getbundle2partsmapping['obsmarkers'] = newfunc
     extensions.wrapfunction(wireproto, 'capabilities', capabilities)
     # wrap command content
     oldcap, args = wireproto.commands['capabilities']