[PATCH 6 of 7 V2] hgweb: abstract call to hgwebdir wsgi function

Gregory Szorc gregory.szorc at gmail.com
Sun Aug 14 21:37:43 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 31fae7f40d317b325ba05930a11a9d0bf91f0c8e
# Parent  ef37b1df0058f54c7b23252b7356bb97b07652d7
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