Patchwork bundle2: remove heads and common arguments to getbundle parts generators

login
register
mail settings
Submitter Mike Hommey
Date Sept. 25, 2014, 4:33 a.m.
Message ID <e661ac94cce8e9a71cc0.1411619580@zenigata.glandium.org>
Download mbox | patch
Permalink /patch/5977/
State Accepted
Headers show

Comments

Mike Hommey - Sept. 25, 2014, 4:33 a.m.
# HG changeset patch
# User Mike Hommey <mh@glandium.org>
# Date 1411613656 -32400
#      Thu Sep 25 11:54:16 2014 +0900
# Node ID e661ac94cce8e9a71cc058b63dacd1625655333a
# Parent  17baf7a6335c720094b1e4d1b2b2c9d9911b5ba5
bundle2: remove heads and common arguments to getbundle parts generators
Pierre-Yves David - Sept. 25, 2014, 4:50 a.m.
On 09/24/2014 09:33 PM, Mike Hommey wrote:
> # HG changeset patch
> # User Mike Hommey <mh@glandium.org>
> # Date 1411613656 -32400
> #      Thu Sep 25 11:54:16 2014 +0900
> # Node ID e661ac94cce8e9a71cc058b63dacd1625655333a
> # Parent  17baf7a6335c720094b1e4d1b2b2c9d9911b5ba5
> bundle2: remove heads and common arguments to getbundle parts generators

pushed to the clowncopter after a change in argument order.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1016,18 +1016,20 @@  def getbundle(repo, source, heads=None, 
     for bcaps in bundlecaps:
         if bcaps.startswith('bundle2='):
             blob = urllib.unquote(bcaps[len('bundle2='):])
             b2caps.update(bundle2.decodecaps(blob))
     bundler = bundle2.bundle20(repo.ui, b2caps)
 
     for name in getbundle2partsorder:
         func = getbundle2partsmapping[name]
-        func(bundler, repo, source, heads=heads, common=common,
-             bundlecaps=bundlecaps, b2caps=b2caps, **kwargs)
+        kwargs['heads'] = heads
+        kwargs['common'] = common
+        func(bundler, repo, source, bundlecaps=bundlecaps, b2caps=b2caps,
+             **kwargs)
 
     return util.chunkbuffer(bundler.getchunks())
 
 @getbundle2partsgenerator('changegroup')
 def _getbundlechangegrouppart(bundler, repo, source, heads=None, common=None,
                               bundlecaps=None, b2caps=None, **kwargs):
     """add a changegroup part to the requested bundle"""
     cg = None
@@ -1035,28 +1037,28 @@  def _getbundlechangegrouppart(bundler, r
         # build changegroup bundle here.
         cg = changegroup.getchangegroup(repo, source, heads=heads,
                                         common=common, bundlecaps=bundlecaps)
 
     if cg:
         bundler.newpart('b2x:changegroup', data=cg.getchunks())
 
 @getbundle2partsgenerator('listkeys')
-def _getbundlelistkeysparts(bundler, repo, source, heads=None, common=None,
-                           bundlecaps=None, b2caps=None, **kwargs):
+def _getbundlelistkeysparts(bundler, repo, source, bundlecaps=None,
+                            b2caps=None, **kwargs):
     """add parts containing listkeys namespaces to the requested bundle"""
     listkeys = kwargs.get('listkeys', ())
     for namespace in listkeys:
         part = bundler.newpart('b2x:listkeys')
         part.addparam('namespace', namespace)
         keys = repo.listkeys(namespace).items()
         part.data = pushkey.encodekeys(keys)
 
 @getbundle2partsgenerator('obsmarkers')
-def _getbundleobsmarkerpart(bundler, repo, source, heads=None, common=None,
+def _getbundleobsmarkerpart(bundler, repo, source, heads=None,
                             bundlecaps=None, b2caps=None, **kwargs):
     """add an obsolescence markers part to the requested bundle"""
     if kwargs.get('obsmarkers', False):
         if heads is None:
             heads = repo.heads()
         subset = [c.node() for c in repo.set('::%ln', heads)]
         markers = repo.obsstore.relevantmarkers(subset)
         buildobsmarkerspart(bundler, markers)