##// END OF EJS Templates
bundle2: transmit capabilities to getbundle during pull...
Pierre-Yves David -
r21143:5bb5d4ba default
parent child Browse files
Show More
@@ -546,6 +546,8 def _pullbundle2(pullop):
546
546
547 For now, the only supported data are changegroup."""
547 For now, the only supported data are changegroup."""
548 kwargs = {'bundlecaps': set(['HG20'])}
548 kwargs = {'bundlecaps': set(['HG20'])}
549 capsblob = bundle2.encodecaps(pullop.repo.bundle2caps)
550 kwargs['bundlecaps'].add('bundle2=' + urllib.quote(capsblob))
549 # pulling changegroup
551 # pulling changegroup
550 pullop.todosteps.remove('changegroup')
552 pullop.todosteps.remove('changegroup')
551 if not pullop.fetch:
553 if not pullop.fetch:
@@ -660,7 +662,12 def getbundle(repo, source, heads=None,
660 return cg
662 return cg
661 # very crude first implementation,
663 # very crude first implementation,
662 # the bundle API will change and the generation will be done lazily.
664 # the bundle API will change and the generation will be done lazily.
663 bundler = bundle2.bundle20(repo.ui)
665 b2caps = {}
666 for bcaps in bundlecaps:
667 if bcaps.startswith('bundle2='):
668 blob = urllib.unquote(bcaps[len('bundle2='):])
669 b2caps.update(bundle2.decodecaps(blob))
670 bundler = bundle2.bundle20(repo.ui, b2caps)
664 part = bundle2.bundlepart('changegroup', data=cg.getchunks())
671 part = bundle2.bundlepart('changegroup', data=cg.getchunks())
665 bundler.addpart(part)
672 bundler.addpart(part)
666 return util.chunkbuffer(bundler.getchunks())
673 return util.chunkbuffer(bundler.getchunks())
General Comments 0
You need to be logged in to leave comments. Login now