[PATCH 13 of 18] configitems: register the 'server.zliblevel' config

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Jul 2 18:25:30 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1498787056 -7200
#      Fri Jun 30 03:44:16 2017 +0200
# Node ID c175b1dadc41c258b4dfff373e150ee0680869ff
# Parent  a3f76daf381d30a3634f5827b069523c91546f82
# EXP-Topic config.register.server
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r c175b1dadc41
configitems: register the 'server.zliblevel' config

diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -134,6 +134,9 @@ coreconfigitem('server', 'uncompressedal
 coreconfigitem('server', 'validate',
     default=False,
 )
+coreconfigitem('server', 'zliblevel',
+    default=-1,
+)
 coreconfigitem('ui', 'clonebundleprefers',
     default=list,
 )
diff --git a/mercurial/hgweb/protocol.py b/mercurial/hgweb/protocol.py
--- a/mercurial/hgweb/protocol.py
+++ b/mercurial/hgweb/protocol.py
@@ -135,7 +135,7 @@ class webproto(wireproto.abstractserverp
         # Don't allow untrusted settings because disabling compression or
         # setting a very high compression level could lead to flooding
         # the server's network or CPU.
-        opts = {'level': self.ui.configint('server', 'zliblevel', -1)}
+        opts = {'level': self.ui.configint('server', 'zliblevel')}
         return HGTYPE, util.compengines['zlib'], opts
 
 def iscmd(cmd):


More information about the Mercurial-devel mailing list