bundle2: allow extensions to extend the getbundle request
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 17 Apr 2014 16:56:15 -0400
changeset 21159 024f38f6d5f6
parent 21158 8f6530b62177
child 21160 564f55b25122
child 21220 b04a2f49cb55
bundle2: allow extensions to extend the getbundle request We want extensions to be able to request extra parts.
mercurial/exchange.py
--- a/mercurial/exchange.py	Thu Apr 17 17:32:34 2014 -0400
+++ b/mercurial/exchange.py	Thu Apr 17 16:56:15 2014 -0400
@@ -578,6 +578,7 @@
         kwargs['heads'] = pullop.heads or pullop.rheads
         if pullop.heads is None and list(pullop.common) == [nullid]:
             pullop.repo.ui.status(_("requesting all changes\n"))
+    _pullbundle2extraprepare(pullop, kwargs)
     if kwargs.keys() == ['format']:
         return # nothing to pull
     bundle = pullop.remote.getbundle('pull', **kwargs)
@@ -588,6 +589,10 @@
     assert len(op.records['changegroup']) == 1
     pullop.cgresult = op.records['changegroup'][0]['return']
 
+def _pullbundle2extraprepare(pullop, kwargs):
+    """hook function so that extensions can extend the getbundle call"""
+    pass
+
 def _pullchangeset(pullop):
     """pull changeset from unbundle into the local repo"""
     # We delay the open of the transaction as late as possible so we