# HG changeset patch
# User Gregory Szorc <gregory.sz...@gmail.com>
# Date 1479679308 28800
#      Sun Nov 20 14:01:48 2016 -0800
# Node ID a550b00e82d531756e73869055123fa6682effe0
# Parent  952478a50f2583be4400c0f6fcc156d73d46711c
protocol: declare transport protocol support for compression

We add an attribute to the HTTP and SSH protocol implementations
indicating whether they support compression. This attribute will
be used in a later patch to conditionally advertise a server
capability.

(We won't advertise the capability on the SSH transport because the
SSH transport doesn't support compressible responses.)

diff --git a/mercurial/hgweb/protocol.py b/mercurial/hgweb/protocol.py
--- a/mercurial/hgweb/protocol.py
+++ b/mercurial/hgweb/protocol.py
@@ -30,6 +30,8 @@ class webproto(wireproto.abstractserverp
         self.req = req
         self.response = ''
         self.ui = ui
+        self.supportscompression = True
+
     def getargs(self, args):
         knownargs = self._args()
         data = {}
diff --git a/mercurial/sshserver.py b/mercurial/sshserver.py
--- a/mercurial/sshserver.py
+++ b/mercurial/sshserver.py
@@ -26,6 +26,7 @@ class sshserver(wireproto.abstractserver
         self.lock = None
         self.fin = ui.fin
         self.fout = ui.fout
+        self.supportscompression = False
 
         hook.redirect(True)
         ui.fout = repo.ui.fout = ui.ferr
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to