diff -r 9263f86b9681 -r 5f3666da6910 mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Wed Jun 03 14:29:11 2015 -0700 +++ b/mercurial/hgweb/hgwebdir_mod.py Mon Jun 01 18:06:20 2015 -0400 @@ -292,6 +292,12 @@ # remove name parts plus accompanying slash path = path[:-len(discarded) - 1] + try: + r = hg.repository(self.ui, path) + directory = False + except (IOError, error.RepoError): + pass + parts = [name] if 'PATH_INFO' in req.env: parts.insert(0, req.env['PATH_INFO'].rstrip('/'))