diff hgext/evolve.py @ 1253:d03583da89c4 stable

pull: fix bundle2 part generation The new part generator (allowing partial pull) was unproperly installed.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 20 Apr 2015 13:36:12 +0200
parents 1556d8fed538
children a2d4901e211e
line wrap: on
line diff
--- a/hgext/evolve.py	Sat Apr 11 10:35:26 2015 -0400
+++ b/hgext/evolve.py	Mon Apr 20 13:36:12 2015 +0200
@@ -2642,20 +2642,28 @@
 
 if getattr(exchange, '_getbundleobsmarkerpart', None) is not None:
     @eh.wrapfunction(exchange, '_getbundleobsmarkerpart')
-    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 kwargs.get('obsmarkers', False):
             if heads is None:
                 heads = repo.heads()
             obscommon = kwargs.get('evo_obscommon', ())
+            assert obscommon
             obsset = repo.set('::%ln - ::%ln', heads, obscommon)
             subset = [c.node() for c in obsset]
             markers = repo.obsstore.relevantmarkers(subset)
             exchange.buildobsmarkerspart(bundler, markers)
 
+    @eh.uisetup
+    def installgetbundlepartgen(ui):
+        origfunc = exchange.getbundle2partsmapping['obsmarkers']
+        def newfunc(*args, **kwargs):
+            return _getbundleobsmarkerpart(origfunc, *args, **kwargs)
+        exchange.getbundle2partsmapping['obsmarkers'] = newfunc
+
 
 @eh.wrapfunction(exchange, '_pullobsolete')
 def _pullobsolete(orig, pullop):