# HG changeset patch # User Brendan Cully # Date 1183738517 25200 # Node ID 4f86c58c6c5686863de09939231aca98f7defcc2 # Parent 13cb25bb760782dddb7cb7a5d28df5e8d0bd9b3d hgwebdir: do not walk up the given path looking for a repository. It is there or it isn't. 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,15 +220,7 @@ class hgwebdir(object): 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 @@ class hgwebdir(object): 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: