changeset 4845:4f86c58c6c56

hgwebdir: do not walk up the given path looking for a repository. It is there or it isn't.
author Brendan Cully <brendan@kublai.com>
date Fri, 06 Jul 2007 09:15:17 -0700
parents 13cb25bb7607
children 40007fe82be9
files mercurial/hgweb/hgwebdir_mod.py
diffstat 1 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Fri Jul 06 08:55:36 2007 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	Fri Jul 06 09:15:17 2007 -0700
@@ -220,15 +220,7 @@
                 req.write(staticfile(static, fname, req) or
                           tmpl('error', error='%r not found' % fname))
             elif virtual:
-                while virtual:
-                    real = dict(self.repos).get(virtual)
-                    if real:
-                        break
-                    up = virtual.rfind('/')
-                    if up < 0:
-                        break
-                    virtual = virtual[:up]
-                if real:
+                if virtual in dict(self.repos):
                     req.env['REPO_NAME'] = virtual
                     try:
                         repo = hg.repository(parentui, real)
@@ -238,7 +230,7 @@
                     except hg.RepoError, inst:
                         req.write(tmpl("error", error=str(inst)))
                 else:
-                    subdir=req.env.get("PATH_INFO", "").strip('/') + '/'
+                    subdir=virtual + '/'
                     if [r for r in self.repos if r[0].startswith(subdir)]:
                         makeindex(req, subdir)
                     else: