# HG changeset patch # User Dirkjan Ochtman # Date 1207221702 -7200 # Node ID a63aed912e54434a1cc88ebda4b713910f3568a4 # Parent da752414978770dd8aaa8f4303eac98563e4555d# Parent 8189e03adb442645f3d5f301fc3d698d918ad86d Merge from crew-stable. diff -r da7524149787 -r a63aed912e54 mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Thu Apr 03 11:18:43 2008 +0200 +++ b/mercurial/hgweb/hgweb_mod.py Thu Apr 03 13:21:42 2008 +0200 @@ -123,8 +123,8 @@ if 'REPO_NAME' in req.env: req.url += req.env['REPO_NAME'] + '/' - if req.env.get('PATH_INFO'): - parts = req.env.get('PATH_INFO').strip('/').split('/') + if 'PATH_INFO' in req.env: + parts = req.env['PATH_INFO'].strip('/').split('/') repo_parts = req.env.get('REPO_NAME', '').split('/') if parts[:len(repo_parts)] == repo_parts: parts = parts[len(repo_parts):] diff -r da7524149787 -r a63aed912e54 mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Thu Apr 03 11:18:43 2008 +0200 +++ b/mercurial/hgweb/hgwebdir_mod.py Thu Apr 03 13:21:42 2008 +0200 @@ -181,7 +181,9 @@ if u.configbool("web", "hidden", untrusted=True): continue - parts = [req.env['PATH_INFO'].rstrip('/'), name] + parts = [name] + if 'PATH_INFO' in req.env: + parts.insert(0, req.env['PATH_INFO'].rstrip('/')) if req.env['SCRIPT_NAME']: parts.insert(0, req.env['SCRIPT_NAME']) url = ('/'.join(parts).replace("//", "/")) + '/' diff -r da7524149787 -r a63aed912e54 tests/test-hgweb-no-path-info --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hgweb-no-path-info Thu Apr 03 13:21:42 2008 +0200 @@ -0,0 +1,59 @@ +#!/bin/sh +# This tests if hgweb and hgwebdir still work if the REQUEST_URI variable is +# no longer passed with the request. Instead, SCRIPT_NAME and PATH_INFO +# should be used from d74fc8dec2b4 onward to route the request. + +mkdir repo +cd repo +hg init +echo foo > bar +hg add bar +hg commit -m "test" -d "0 0" -u "Testing" +hg tip + +cat > request.py < + + + http://127.0.0.1/ + + + repo Changelog + 1970-01-01T00:00:00+00:00 + + + test + http://www.selenic.com/mercurial/#changeset-4cbec7e6f8c42eb52b6b52670e1f7560ae9a101e + + + Testing + Testing + + 1970-01-01T00:00:00+00:00 + 1970-01-01T00:00:00+00:00 + +
+
test
+
+
+
+ +
+ +---- ERRORS + +---- HEADERS +200 Script output follows +---- DATA +[('Content-Type', 'text/plain; charset=ascii')] + +repo/ + + +---- ERRORS +