# HG changeset patch # User Henrik Stuart # Date 1258642497 -3600 # Node ID 510122bb3c7fcef5f96d32cc785b3ae95c1b2d9e # Parent 38170eeed18c0dd3bafcde9306bca26d2bc789d5 hgweb: fix error in 38170eeed18c and introduce test for change diff -r 38170eeed18c -r 510122bb3c7f mercurial/hgweb/hgweb_mod.py --- 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 diff -r 38170eeed18c -r 510122bb3c7f tests/test-non-interactive-wsgi --- 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 diff -r 38170eeed18c -r 510122bb3c7f tests/test-non-interactive-wsgi.out --- 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']