# HG changeset patch # User Yuya Nishihara # Date 1282660251 -32400 # Node ID 9617803b1acbb83e9611f56fe5666408110c2e1c # Parent 927d63be166b11e16756eea3b9e9f8b82620dbbd 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. diff -r 927d63be166b -r 9617803b1acb mercurial/hgweb/hgwebdir_mod.py --- 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 diff -r 927d63be166b -r 9617803b1acb tests/test-hgwebdir --- a/tests/test-hgwebdir Wed Aug 25 13:29:46 2010 +0200 +++ b/tests/test-hgwebdir Tue Aug 24 23:30:51 2010 +0900 @@ -26,6 +26,10 @@ echo c > c/c hg --cwd c ci -Amc -d'3 0' +# create repository without .hg/store +hg init nostore +rm -R nostore/.hg/store + root=`pwd` cd .. @@ -112,6 +116,20 @@ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw' +"$TESTDIR/killdaemons.py" +cat > paths.conf <> $DAEMON_PIDS +echo % test inexistent and inaccessible repo should be ignored silently +"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/' + + cat > collections.conf < + + + + + + +Mercurial repositories index + + + +
+ +
+

Mercurial Repositories

+ + + + + + + + + + +
NameDescriptionContactLast modified 
+
+
+ + + + + % collections: should succeed 200 Script output follows