hgweb: fix error in
38170eeed18c and introduce test for change
--- a/mercurial/hgweb/hgweb_mod.py Thu Nov 19 10:32:33 2009 +0100
+++ b/mercurial/hgweb/hgweb_mod.py Thu Nov 19 15:54:57 2009 +0100
@@ -56,7 +56,7 @@
def refresh(self, request=None):
if request:
- self.ui.environ = request.environ
+ self.repo.ui.environ = request.env
mtime = get_mtime(self.repo.root)
if mtime != self.mtime:
self.mtime = mtime
--- a/tests/test-non-interactive-wsgi Thu Nov 19 10:32:33 2009 +0100
+++ b/tests/test-non-interactive-wsgi Thu Nov 19 15:54:57 2009 +0100
@@ -60,9 +60,14 @@
'SERVER_PROTOCOL': 'HTTP/1.0'
}
-hgweb('.')(env, startrsp)
+i = hgweb('.')
+i(env, startrsp)
print '---- ERRORS'
print errors.getvalue()
+print '---- OS.ENVIRON wsgi variables'
+print [x for x in os.environ if x.startswith('wsgi')]
+print '---- request.ENVIRON wsgi variables'
+print [x for x in i.repo.ui.environ if x.startswith('wsgi')]
EOF
python request.py
--- a/tests/test-non-interactive-wsgi.out Thu Nov 19 10:32:33 2009 +0100
+++ b/tests/test-non-interactive-wsgi.out Thu Nov 19 15:54:57 2009 +0100
@@ -10,3 +10,7 @@
[('Content-Type', 'text/html; charset=ascii')]
---- ERRORS
+---- OS.ENVIRON wsgi variables
+[]
+---- request.ENVIRON wsgi variables
+['wsgi.input', 'wsgi.multithread', 'wsgi.version', 'wsgi.run_once', 'wsgi.errors', 'wsgi.multiprocess', 'wsgi.url_scheme']