Mercurial > hg
changeset 9888:510122bb3c7f
hgweb: fix error in 38170eeed18c and introduce test for change
author | Henrik Stuart <hg@hstuart.dk> |
---|---|
date | Thu, 19 Nov 2009 15:54:57 +0100 |
parents | 38170eeed18c |
children | 38864218c4cc |
files | mercurial/hgweb/hgweb_mod.py tests/test-non-interactive-wsgi tests/test-non-interactive-wsgi.out |
diffstat | 3 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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']