Patchwork [1,of,4] bundle2: pass b2caps down to functions adding bundle2 parts for getbundle

login
register
mail settings
Submitter Mike Hommey
Date Sept. 25, 2014, 2:55 a.m.
Message ID <5c959b16e3f54b2cdc21.1411613758@zenigata.glandium.org>
Download mbox | patch
Permalink /patch/5975/
State Accepted
Headers show

Comments

Mike Hommey - Sept. 25, 2014, 2:55 a.m.
# HG changeset patch
# User Mike Hommey <mh@glandium.org>
# Date 1411611097 -32400
#      Thu Sep 25 11:11:37 2014 +0900
# Node ID 5c959b16e3f54b2cdc212264a5354574486e49b3
# Parent  bc01442c6e030eee52c5f5524a28a50b1c25a4a6
bundle2: pass b2caps down to functions adding bundle2 parts for getbundle

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1000,32 +1000,33 @@  def getbundle(repo, source, heads=None, 
         bundler.newpart('b2x:changegroup', data=cg.getchunks())
     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)
     _getbundleobsmarkerpart(bundler, repo, source, heads=heads, common=common,
-                            bundlecaps=bundlecaps, **kwargs)
+                            bundlecaps=bundlecaps, b2caps=b2caps, **kwargs)
     _getbundleextrapart(bundler, repo, source, heads=heads, common=common,
-                        bundlecaps=bundlecaps, **kwargs)
+                        bundlecaps=bundlecaps, b2caps=b2caps, **kwargs)
     return util.chunkbuffer(bundler.getchunks())
 
 def _getbundleobsmarkerpart(bundler, repo, source, heads=None, common=None,
-                            bundlecaps=None, **kwargs):
+                            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)
 
 def _getbundleextrapart(bundler, repo, source, heads=None, common=None,
-                        bundlecaps=None, **kwargs):
+                        bundlecaps=None, b2caps=None, **kwargs):
     """hook function to let extensions add parts to the requested bundle"""
     pass
 
 def check_heads(repo, their_heads, context):
     """check if the heads of a repo have been modified
 
     Used by peer for unbundling.
     """