[PATCH 5 of 6] hgweb: abstract call to hgwebdir wsgi function
Gregory Szorc
gregory.szorc at gmail.com
Sun Aug 14 20:03:57 EDT 2016
# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1471215810 25200
# Sun Aug 14 16:03:30 2016 -0700
# Node ID a04a42c139225b2f5b3166541fd7466190459822
# Parent 7d945851998c89444a8a53ac7daf1e0798cb7838
hgweb: abstract call to hgwebdir wsgi function
The function names and behavior now matches hgweb. The reason for this
will be obvious in the next patch.
diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -212,16 +212,19 @@ class hgwebdir(object):
allow_read = ui.configlist('web', 'allow_read', untrusted=True)
# by default, allow reading if no allow_read option has been set
if (not allow_read) or ismember(ui, user, allow_read):
return True
return False
def run_wsgi(self, req):
+ return self._runwsgi(req)
+
+ def _runwsgi(self, req):
try:
self.refresh()
virtual = req.env.get("PATH_INFO", "").strip('/')
tmpl = self.templater(req)
ctype = tmpl('mimetype', encoding=encoding.encoding)
ctype = templater.stringify(ctype)
More information about the Mercurial-devel
mailing list