diff mercurial/hgweb/hgweb_mod.py @ 36917:f0a851542a05

hgweb: remove wsgirequest (API) Good riddance. .. api:: The old ``wsgirequest`` class for handling everything WSGI in hgweb has been replaced by separate request and response types. Various high-level functions in the hgweb WSGI applications now receive these new types as arguments instead of the old ``wsgirequest`` type. Differential Revision: https://phab.mercurial-scm.org/D2832
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 11 Mar 2018 16:29:54 -0700
parents 84110a1d0f7d
children 6ff6e1d6b5b8
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Sat Mar 10 15:24:24 2018 +0530
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Mar 11 16:29:54 2018 -0700
@@ -290,10 +290,12 @@
 
         This may be called by multiple threads.
         """
-        req = requestmod.wsgirequest(env, respond)
-        return self.run_wsgi(req)
+        req = requestmod.parserequestfromenv(env)
+        res = requestmod.wsgiresponse(req, respond)
 
-    def run_wsgi(self, wsgireq):
+        return self.run_wsgi(req, res)
+
+    def run_wsgi(self, req, res):
         """Internal method to run the WSGI application.
 
         This is typically only called by Mercurial. External consumers
@@ -302,12 +304,10 @@
         with self._obtainrepo() as repo:
             profile = repo.ui.configbool('profiling', 'enabled')
             with profiling.profile(repo.ui, enabled=profile):
-                for r in self._runwsgi(wsgireq, repo):
+                for r in self._runwsgi(req, res, repo):
                     yield r
 
-    def _runwsgi(self, wsgireq, repo):
-        req = wsgireq.req
-        res = wsgireq.res
+    def _runwsgi(self, req, res, repo):
         rctx = requestcontext(self, repo, req, res)
 
         # This state is global across all threads.