Patchwork [5,of,6] hgweb: abstract call to hgwebdir wsgi function

login
register
mail settings
Submitter Gregory Szorc
Date Aug. 15, 2016, 12:03 a.m.
Message ID <a04a42c139225b2f5b31.1471219437@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/16292/
State Superseded
Headers show

Comments

Gregory Szorc - Aug. 15, 2016, 12:03 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.

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)