mercurial/wireproto.py
changeset 35787 a84dbc87dae9
parent 35785 ba15580e53d5
child 35860 d9e71cce3b2f
child 36753 742ce6fbc109
--- a/mercurial/wireproto.py	Mon Jan 22 12:38:04 2018 -0800
+++ b/mercurial/wireproto.py	Mon Jan 22 12:12:29 2018 -0800
@@ -862,7 +862,7 @@
             raise error.Abort(bundle2requiredmain,
                               hint=bundle2requiredhint)
 
-    preferuncompressed = False
+    prefercompressed = True
 
     try:
         if repo.ui.configbool('server', 'disablefullbundle'):
@@ -879,6 +879,7 @@
 
         info, chunks = exchange.getbundlechunks(repo, 'serve',
                                                 **pycompat.strkwargs(opts))
+        prefercompressed = info.get('prefercompressed', True)
     except error.Abort as exc:
         # cleanly forward Abort error to the client
         if not exchange.bundle2requested(opts.get('bundlecaps')):
@@ -894,9 +895,9 @@
         bundler.addpart(bundle2.bundlepart('error:abort',
                                            manargs, advargs))
         chunks = bundler.getchunks()
-        preferuncompressed = True
+        prefercompressed = False
 
-    return streamres(gen=chunks, prefer_uncompressed=preferuncompressed)
+    return streamres(gen=chunks, prefer_uncompressed=not prefercompressed)
 
 @wireprotocommand('heads')
 def heads(repo, proto):