# HG changeset patch # User Henrik Stuart # Date 2009-11-19 14:54:57 # Node ID 510122bb3c7fcef5f96d32cc785b3ae95c1b2d9e # Parent 38170eeed18c0dd3bafcde9306bca26d2bc789d5 hgweb: fix error in 38170eeed18c and introduce test for change diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -56,7 +56,7 @@ class hgweb(object): 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 --git a/tests/test-non-interactive-wsgi b/tests/test-non-interactive-wsgi --- a/tests/test-non-interactive-wsgi +++ b/tests/test-non-interactive-wsgi @@ -60,9 +60,14 @@ env = { '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 --git a/tests/test-non-interactive-wsgi.out b/tests/test-non-interactive-wsgi.out --- a/tests/test-non-interactive-wsgi.out +++ b/tests/test-non-interactive-wsgi.out @@ -10,3 +10,7 @@ 200 Script output follows [('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']