diff --git a/mercurial/hgweb/wsgicgi.py b/mercurial/hgweb/wsgicgi.py --- a/mercurial/hgweb/wsgicgi.py +++ b/mercurial/hgweb/wsgicgi.py @@ -16,9 +16,7 @@ def launch(application): util.set_binary(sys.stdout) environ = dict(os.environ.items()) - if 'PATH_INFO' not in environ: - environ['PATH_INFO'] = '' - + environ.setdefault('PATH_INFO', '') environ['wsgi.input'] = sys.stdin environ['wsgi.errors'] = sys.stderr environ['wsgi.version'] = (1, 0) diff --git a/tests/test-hgweb b/tests/test-hgweb --- a/tests/test-hgweb +++ b/tests/test-hgweb @@ -1,4 +1,5 @@ #!/bin/sh +# Some tests for hgweb. Tests static files, plain files and different 404's. hg init test cd test diff --git a/tests/test-hgweb-no-request-uri b/tests/test-hgweb-no-request-uri --- a/tests/test-hgweb-no-request-uri +++ b/tests/test-hgweb-no-request-uri @@ -1,4 +1,7 @@ #!/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 diff --git a/tests/test-hgwebdir b/tests/test-hgwebdir --- a/tests/test-hgwebdir +++ b/tests/test-hgwebdir @@ -1,4 +1,6 @@ #!/bin/sh +# Tests some basic hgwebdir functionality. Tests setting up paths and +# collection, different forms of 404s and the subdirectory support. mkdir webdir cd webdir diff --git a/tests/test-newcgi b/tests/test-newcgi --- a/tests/test-newcgi +++ b/tests/test-newcgi @@ -1,4 +1,6 @@ #!/bin/sh +# This tests if CGI files from after d0db3462d568 but +# before d74fc8dec2b4 still work. hg init test diff --git a/tests/test-newercgi b/tests/test-newercgi --- a/tests/test-newercgi +++ b/tests/test-newercgi @@ -1,4 +1,5 @@ #!/bin/sh +# This is a rudimentary test of the CGI files as of d74fc8dec2b4. hg init test 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 @@ -1,4 +1,6 @@ #!/bin/sh +# Tests if hgweb can run without touching sys.stdin, as is required +# by the WSGI standard and strictly implemented by mod_wsgi. mkdir repo cd repo diff --git a/tests/test-oldcgi b/tests/test-oldcgi --- a/tests/test-oldcgi +++ b/tests/test-oldcgi @@ -1,4 +1,5 @@ #!/bin/sh +# This tests if CGI files from before d0db3462d568 still work. hg init test