--- a/mercurial/hgweb/hgwebdir_mod.py Wed Nov 28 13:58:31 2007 -0800
+++ b/mercurial/hgweb/hgwebdir_mod.py Fri Nov 30 18:23:18 2007 +0100
@@ -11,6 +11,7 @@
from mercurial import ui, hg, util, templater
from common import ErrorResponse, get_mtime, staticfile, style_map, paritygen
from hgweb_mod import hgweb
+from request import wsgirequest
# This is a stopgap
class hgwebdir(object):
@@ -60,10 +61,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):