Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/hgweb_mod.py @ 26161:16d54bbdbf89
hgweb: remove hgweb.configbool
It is redundant with requestcontext.configbool.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 22 Aug 2015 15:32:16 -0700 |
parents | 952e0564b46e |
children | 268b39770c28 |
comparison
equal
deleted
inserted
replaced
26160:952e0564b46e | 26161:16d54bbdbf89 |
---|---|
168 # The CGI scripts are often run by a user different from the repo owner. | 168 # The CGI scripts are often run by a user different from the repo owner. |
169 # Trust the settings from the .hg/hgrc files by default. | 169 # Trust the settings from the .hg/hgrc files by default. |
170 def config(self, section, name, default=None, untrusted=True): | 170 def config(self, section, name, default=None, untrusted=True): |
171 return self.repo.ui.config(section, name, default, | 171 return self.repo.ui.config(section, name, default, |
172 untrusted=untrusted) | 172 untrusted=untrusted) |
173 | |
174 def configbool(self, section, name, default=False, untrusted=True): | |
175 return self.repo.ui.configbool(section, name, default, | |
176 untrusted=untrusted) | |
177 | 173 |
178 def _getview(self, repo): | 174 def _getview(self, repo): |
179 """The 'web.view' config controls changeset filter to hgweb. Possible | 175 """The 'web.view' config controls changeset filter to hgweb. Possible |
180 values are ``served``, ``visible`` and ``all``. Default is ``served``. | 176 values are ``served``, ``visible`` and ``all``. Default is ``served``. |
181 The ``served`` filter only shows changesets that can be pulled from the | 177 The ``served`` filter only shows changesets that can be pulled from the |
340 | 336 |
341 if cmd == '': | 337 if cmd == '': |
342 req.form['cmd'] = [tmpl.cache['default']] | 338 req.form['cmd'] = [tmpl.cache['default']] |
343 cmd = req.form['cmd'][0] | 339 cmd = req.form['cmd'][0] |
344 | 340 |
345 if self.configbool('web', 'cache', True): | 341 if rctx.configbool('web', 'cache', True): |
346 caching(self, req) # sets ETag header or raises NOT_MODIFIED | 342 caching(self, req) # sets ETag header or raises NOT_MODIFIED |
347 if cmd not in webcommands.__all__: | 343 if cmd not in webcommands.__all__: |
348 msg = 'no such method: %s' % cmd | 344 msg = 'no such method: %s' % cmd |
349 raise ErrorResponse(HTTP_BAD_REQUEST, msg) | 345 raise ErrorResponse(HTTP_BAD_REQUEST, msg) |
350 elif cmd == 'file' and 'raw' in req.form.get('style', []): | 346 elif cmd == 'file' and 'raw' in req.form.get('style', []): |