mercurial/exchange.py
changeset 35759 c24dad55ac19
parent 35578 86f9aabed67b
child 35761 1908d360f977
--- a/mercurial/exchange.py	Wed Jan 17 16:35:22 2018 +0100
+++ b/mercurial/exchange.py	Wed Jan 17 16:36:23 2018 +0100
@@ -1747,6 +1747,19 @@
 
     return bundler.getchunks()
 
+@getbundle2partsgenerator('stream')
+def _getbundlestream(bundler, repo, source, bundlecaps=None,
+                     b2caps=None, heads=None, common=None, **kwargs):
+    if not kwargs.get('stream', False):
+        return
+    filecount, bytecount, it = streamclone.generatev2(repo)
+    requirements = ' '.join(repo.requirements)
+    part = bundler.newpart('stream', data=it)
+    part.addparam('bytecount', '%d' % bytecount, mandatory=True)
+    part.addparam('filecount', '%d' % filecount, mandatory=True)
+    part.addparam('requirements', requirements, mandatory=True)
+    part.addparam('version', 'v2', mandatory=True)
+
 @getbundle2partsgenerator('changegroup')
 def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None,
                               b2caps=None, heads=None, common=None, **kwargs):