mercurial/hgweb/request.py
changeset 37616 5e81cf9651c1
parent 37606 da84e26d85ed
child 37818 877185de62cf
--- a/mercurial/hgweb/request.py	Wed Apr 11 12:51:09 2018 -0700
+++ b/mercurial/hgweb/request.py	Thu Apr 05 15:42:40 2018 -0400
@@ -161,6 +161,12 @@
         env = {k: v.encode('latin-1') if isinstance(v, str) else v
                for k, v in env.iteritems()}
 
+    # Some hosting solutions are emulating hgwebdir, and dispatching directly
+    # to an hgweb instance using this environment variable.  This was always
+    # checked prior to d7fd203e36cc; keep doing so to avoid breaking them.
+    if not reponame:
+        reponame = env.get('REPO_NAME')
+
     if altbaseurl:
         altbaseurl = util.url(altbaseurl)