mercurial/hgweb/hgweb_mod.py
changeset 5566 d74fc8dec2b4
parent 5565 feac5b0bf9ba
child 5572 9c7f543405c1
child 5579 e15f7db0f0ee
--- a/mercurial/hgweb/hgweb_mod.py	Wed Nov 28 13:58:31 2007 -0800
+++ b/mercurial/hgweb/hgweb_mod.py	Fri Nov 30 18:23:18 2007 +0100
@@ -13,6 +13,7 @@
 from mercurial import mdiff, ui, hg, util, archival, streamclone, patch
 from mercurial import revlog, templater
 from common import ErrorResponse, get_mtime, staticfile, style_map, paritygen
+from request import wsgirequest
 
 def _up(p):
     if p[0] != "/":
@@ -671,10 +672,12 @@
         if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
             raise RuntimeError("This function is only intended to be called while running as a CGI script.")
         import mercurial.hgweb.wsgicgi as wsgicgi
-        from request import wsgiapplication
-        def make_web_app():
-            return self
-        wsgicgi.launch(wsgiapplication(make_web_app))
+        wsgicgi.launch(self)
+
+    def __call__(self, env, respond):
+        req = wsgirequest(env, respond)
+        self.run_wsgi(req)
+        return req
 
     def run_wsgi(self, req):
         def header(**map):