Patchwork [3,of,5,hgweb-thread-isolation] hgweb: remove hgweb.configbool

login
register
mail settings
Submitter Gregory Szorc
Date Sept. 1, 2015, 8:58 p.m.
Message ID <aff08d371fd09087c494.1441141135@gps-mbp>
Download mbox | patch
Permalink /patch/10361/
State Superseded
Commit 16d54bbdbf8916be5ad065d15b77bedef0f07a1e
Headers show

Comments

Gregory Szorc - Sept. 1, 2015, 8:58 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1440282736 25200
#      Sat Aug 22 15:32:16 2015 -0700
# Node ID aff08d371fd09087c49479900c29c6d0e836ff1a
# Parent  135600f7a3b1125c9d405a17aab9fa33e5b4c924
hgweb: remove hgweb.configbool

It is redundant with requestcontext.configbool.

Patch

diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -169,12 +169,8 @@  class hgweb(object):
     def config(self, section, name, default=None, untrusted=True):
         return self.repo.ui.config(section, name, default,
                                    untrusted=untrusted)
 
-    def configbool(self, section, name, default=False, untrusted=True):
-        return self.repo.ui.configbool(section, name, default,
-                                       untrusted=untrusted)
-
     def _getview(self, repo):
         """The 'web.view' config controls changeset filter to hgweb. Possible
         values are ``served``, ``visible`` and ``all``. Default is ``served``.
         The ``served`` filter only shows changesets that can be pulled from the
@@ -340,9 +336,9 @@  class hgweb(object):
             if cmd == '':
                 req.form['cmd'] = [tmpl.cache['default']]
                 cmd = req.form['cmd'][0]
 
-            if self.configbool('web', 'cache', True):
+            if rctx.configbool('web', 'cache', True):
                 caching(self, req) # sets ETag header or raises NOT_MODIFIED
             if cmd not in webcommands.__all__:
                 msg = 'no such method: %s' % cmd
                 raise ErrorResponse(HTTP_BAD_REQUEST, msg)