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

Mike Hommey mh at glandium.org
Thu Sep 25 02:55:58 UTC 2014


# HG changeset patch
# User Mike Hommey <mh at 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

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.
     """


More information about the Mercurial-devel mailing list