# HG changeset patch # User Pulkit Goyal # Date 2018-10-10 16:46:13 # Node ID 74558635dad53eccbbe2e67df835df0873d5c870 # Parent 58ebf50838430f5f514a2fa0bdc63505642fe738 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 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 @@ def narrow_widen(repo, proto, oldinclude ellipses: whether to send ellipses data or not """ + preferuncompressed = False try: oldincludes = wireprototypes.decodelist(oldincludes) newincludes = wireprototypes.decodelist(newincludes) @@ -92,9 +93,11 @@ def narrow_widen(repo, proto, oldinclude 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',