mercurial/hgweb/hgwebdir_mod.py
changeset 52640 24ee91ba9aa8
parent 52416 0a81f3ef054c
child 52644 e627cc25b6f3
equal deleted inserted replaced
52639:9db77d46de79 52640:24ee91ba9aa8
   150                 path = path[: -len(discarded) - 1]
   150                 path = path[: -len(discarded) - 1]
   151 
   151 
   152                 try:
   152                 try:
   153                     hg.repository(ui, path)
   153                     hg.repository(ui, path)
   154                     directory = False
   154                     directory = False
   155                 except (IOError, error.RepoError):
   155                 except (OSError, error.RepoError):
   156                     pass
   156                     pass
   157 
   157 
   158         parts = [
   158         parts = [
   159             req.apppath.strip(b'/'),
   159             req.apppath.strip(b'/'),
   160             subdir.strip(b'/'),
   160             subdir.strip(b'/'),
   209             continue
   209             continue
   210 
   210 
   211         # update time with local timezone
   211         # update time with local timezone
   212         try:
   212         try:
   213             r = hg.repository(ui, path)
   213             r = hg.repository(ui, path)
   214         except IOError:
   214         except OSError:
   215             u.warn(_(b'error accessing repository at %s\n') % path)
   215             u.warn(_(b'error accessing repository at %s\n') % path)
   216             continue
   216             continue
   217         except error.RepoError:
   217         except error.RepoError:
   218             u.warn(_(b'error accessing repository at %s\n') % path)
   218             u.warn(_(b'error accessing repository at %s\n') % path)
   219             continue
   219             continue
   473                     )
   473                     )
   474                     try:
   474                     try:
   475                         # ensure caller gets private copy of ui
   475                         # ensure caller gets private copy of ui
   476                         repo = hg.repository(self.ui.copy(), real)
   476                         repo = hg.repository(self.ui.copy(), real)
   477                         return hgweb_mod.hgweb(repo).run_wsgi(req, res)
   477                         return hgweb_mod.hgweb(repo).run_wsgi(req, res)
   478                     except IOError as inst:
   478                     except OSError as inst:
   479                         msg = encoding.strtolocal(inst.strerror)
   479                         msg = encoding.strtolocal(inst.strerror)
   480                         raise ErrorResponse(HTTP_SERVER_ERROR, msg)
   480                         raise ErrorResponse(HTTP_SERVER_ERROR, msg)
   481                     except error.RepoError as inst:
   481                     except error.RepoError as inst:
   482                         raise ErrorResponse(HTTP_SERVER_ERROR, bytes(inst))
   482                         raise ErrorResponse(HTTP_SERVER_ERROR, bytes(inst))
   483 
   483