diff mercurial/hgweb/hgwebdir_mod.py @ 12038:9617803b1acb stable

hgweb: handle exception of misconfigured path on index page If hgweb.config contains wrong path mapping, hgweb causes internal server error on repository index page. This patch changes makeindex() to ignore RepoError, because it looks to be designed to suppress configuration error.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 24 Aug 2010 23:30:51 +0900
parents 8f8a7976f4bc
children 94e7bd38d9a3
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py	Wed Aug 25 13:29:46 2010 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	Tue Aug 24 23:30:51 2010 +0900
@@ -233,6 +233,10 @@
                 # update time with local timezone
                 try:
                     r = hg.repository(self.ui, path)
+                except error.RepoError:
+                    u.warn(_('error accessing repository at %s\n') % path)
+                    continue
+                try:
                     d = (get_mtime(r.spath), util.makedate()[1])
                 except OSError:
                     continue