mercurial/exchange.py
changeset 35787 a84dbc87dae9
parent 35785 ba15580e53d5
child 35788 b116a66bcc44
--- a/mercurial/exchange.py	Mon Jan 22 12:38:04 2018 -0800
+++ b/mercurial/exchange.py	Mon Jan 22 12:12:29 2018 -0800
@@ -1763,6 +1763,8 @@
         func(bundler, repo, source, bundlecaps=bundlecaps, b2caps=b2caps,
              **pycompat.strkwargs(kwargs))
 
+    info['prefercompressed'] = bundler.prefercompressed
+
     return info, bundler.getchunks()
 
 @getbundle2partsgenerator('stream')
@@ -1770,6 +1772,12 @@
                      b2caps=None, heads=None, common=None, **kwargs):
     if not kwargs.get('stream', False):
         return
+
+    # Stream clones don't compress well. And compression undermines a
+    # goal of stream clones, which is to be fast. Communicate the desire
+    # to avoid compression to consumers of the bundle.
+    bundler.prefercompressed = False
+
     filecount, bytecount, it = streamclone.generatev2(repo)
     requirements = ' '.join(sorted(repo.requirements))
     part = bundler.newpart('stream', data=it)