# HG changeset patch # User Pierre-Yves David # Date 2014-04-17 21:32:34 # Node ID 8f6530b621774ef855bfc88ba348326db8061bd9 # Parent 60ad2ea5b106caf15b2053ba6389eac0571b1705 bundle2: add a way to add parts during a `getbundle` request We add a hook function to let extensions add parts to the bundle. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -691,8 +691,15 @@ def getbundle(repo, source, heads=None, bundler = bundle2.bundle20(repo.ui, b2caps) part = bundle2.bundlepart('b2x:changegroup', data=cg.getchunks()) bundler.addpart(part) + _getbundleextrapart(bundler, repo, source, heads=None, common=None, + bundlecaps=None, **kwargs) return util.chunkbuffer(bundler.getchunks()) +def _getbundleextrapart(bundler, repo, source, heads=None, common=None, + bundlecaps=None, **kwargs): + """hook function to let extensions add parts to the requested bundle""" + pass + class PushRaced(RuntimeError): """An exception raised during unbundling that indicate a push race"""