diff -r 69609f43c752 -r d0c7ffc4c8bc mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Fri May 29 13:11:52 2015 -0700 +++ b/mercurial/hgweb/hgwebdir_mod.py Thu Jun 04 17:51:19 2015 -0500 @@ -291,6 +291,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('/'))