# HG changeset patch # User Brendan Cully # Date 1183846168 25200 # Node ID 9a45e1597d0840da7f8bf67c4061912db43632c3 # Parent 7031d9e2fa4555f3ae8bd4abb4c91b006101e2d4# Parent 035489f608429e469bbe015c586c4c4194c21744 Merge with crew diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -220,8 +220,15 @@ class hgwebdir(object): req.write(staticfile(static, fname, req) or tmpl('error', error='%r not found' % fname)) elif virtual: + repos = dict(self.repos) + # browse subdirectories + subdir = virtual + '/' + if [r for r in repos if r.startswith(subdir)]: + makeindex(req, subdir) + return + while virtual: - real = dict(self.repos).get(virtual) + real = repos.get(virtual) if real: break up = virtual.rfind('/') @@ -238,11 +245,7 @@ class hgwebdir(object): except hg.RepoError, inst: req.write(tmpl("error", error=str(inst))) else: - subdir=req.env.get("PATH_INFO", "").strip('/') + '/' - if [r for r in self.repos if r[0].startswith(subdir)]: - makeindex(req, subdir) - else: - req.write(tmpl("notfound", repo=virtual)) + req.write(tmpl("notfound", repo=virtual)) else: if req.form.has_key('static'): static = os.path.join(templater.templatepath(), "static")