diff tests/test-hgwebdir @ 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
line wrap: on
line diff
--- 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 <<EOF
+[paths]
+nostore = $root/nostore
+inexistent = $root/inexistent
+EOF
+
+hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
+    -A access-paths.log -E error-paths-4.log
+cat hg.pid >> $DAEMON_PIDS
+echo % test inexistent and inaccessible repo should be ignored silently
+"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/'
+
+
 cat > collections.conf <<EOF
 [collections]
 $root=$root