D4934: narrow: don't compress the bundle2 when sending 'error:abort'

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Wed Oct 10 16:51:35 UTC 2018


pulkit created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: martinvonz.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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'.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4934

AFFECTED FILES
  hgext/narrow/narrowwirepeer.py

CHANGE DETAILS

diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py
--- a/hgext/narrow/narrowwirepeer.py
+++ b/hgext/narrow/narrowwirepeer.py
@@ -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',



To: pulkit, durin42, martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list