mercurial/hgweb/hgwebdir_mod.py
changeset 36903 d7fd203e36cc
parent 36901 a5c478843c82
child 36906 219b23359f4c
--- a/mercurial/hgweb/hgwebdir_mod.py	Sun Mar 11 12:53:47 2018 -0700
+++ b/mercurial/hgweb/hgwebdir_mod.py	Sun Mar 11 13:11:13 2018 -0700
@@ -452,13 +452,10 @@
             for virtualrepo in _virtualdirs():
                 real = repos.get(virtualrepo)
                 if real:
-                    wsgireq.env['REPO_NAME'] = virtualrepo
-                    # We have to re-parse because of updated environment
-                    # variable.
-                    # TODO this is kind of hacky and we should have a better
-                    # way of doing this than with REPO_NAME side-effects.
+                    # Re-parse the WSGI environment to take into account our
+                    # repository path component.
                     wsgireq.req = requestmod.parserequestfromenv(
-                        wsgireq.env, wsgireq.req.bodyfh)
+                        wsgireq.env, wsgireq.req.bodyfh, reponame=virtualrepo)
                     try:
                         # ensure caller gets private copy of ui
                         repo = hg.repository(self.ui.copy(), real)