narrow: don't compress the bundle2 when sending 'error:abort'
authorPulkit Goyal <pulkit@yandex-team.ru>
Wed, 10 Oct 2018 19:46:13 +0300
changeset 40148 74558635dad5
parent 40147 58ebf5083843
child 40149 9b0cdfb3c11e
narrow: don't compress the bundle2 when sending 'error:abort' This is similar to waht getbundle() does and also explicitly specifies that we should get a compressed bundle2 in normal cases when not sending 'error:abort'. Differential Revision: https://phab.mercurial-scm.org/D4934
hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py	Thu Oct 11 03:38:23 2018 +0530
+++ b/hgext/narrow/narrowwirepeer.py	Wed Oct 10 19:46:13 2018 +0300
@@ -57,6 +57,7 @@
     ellipses: whether to send ellipses data or not
     """
 
+    preferuncompressed = False
     try:
         oldincludes = wireprototypes.decodelist(oldincludes)
         newincludes = wireprototypes.decodelist(newincludes)
@@ -92,9 +93,11 @@
         if exc.hint is not None:
             advargs.append(('hint', exc.hint))
         bundler.addpart(bundle2.bundlepart('error:abort', manargs, advargs))
+        preferuncompressed = True
 
     chunks = bundler.getchunks()
-    return wireprototypes.streamres(gen=chunks)
+    return wireprototypes.streamres(gen=chunks,
+                                    prefer_uncompressed=preferuncompressed)
 
 def peernarrowwiden(remote, **kwargs):
     for ch in ('oldincludes', 'newincludes', 'oldexcludes', 'newexcludes',