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

login
register
mail settings
Submitter Pierre-Yves David
Date July 2, 2017, 10:25 p.m.
Message ID <c175b1dadc41c258b4df.1499034330@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21934/
State Accepted
Headers show

Comments

Pierre-Yves David - July 2, 2017, 10:25 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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

Patch

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):