mercurial/exchange.py
changeset 21645 aed14bb165f3
parent 21644 17755dd8c509
child 21654 ddf9a00c1239
--- a/mercurial/exchange.py	Sat May 24 16:20:09 2014 -0700
+++ b/mercurial/exchange.py	Thu May 22 13:31:33 2014 -0700
@@ -532,9 +532,7 @@
     """pull data using bundle2
 
     For now, the only supported data are changegroup."""
-    kwargs = {'bundlecaps': set(['HG2X'])}
-    capsblob = bundle2.encodecaps(pullop.repo.bundle2caps)
-    kwargs['bundlecaps'].add('bundle2=' + urllib.quote(capsblob))
+    kwargs = {'bundlecaps': caps20to10(pullop.repo)}
     # pulling changegroup
     pullop.todosteps.remove('changegroup')
 
@@ -636,6 +634,13 @@
             pullop.repo.invalidatevolatilesets()
     return tr
 
+def caps20to10(repo):
+    """return a set with appropriate options to use bundle20 during getbundle"""
+    caps = set(['HG2X'])
+    capsblob = bundle2.encodecaps(repo.bundle2caps)
+    caps.add('bundle2=' + urllib.quote(capsblob))
+    return caps
+
 def getbundle(repo, source, heads=None, common=None, bundlecaps=None,
               **kwargs):
     """return a full bundle (with potentially multiple kind of parts)