diff tests/test-hgwebdir.t @ 13403:8ed91088acbb

hgweb: make paths wildcards expanding in a repo root match repo correctly There was a trailing '/' too much when the wildcard part expanded to nothing. The consequence was that the repo was announced but didn't work.
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 15 Feb 2011 01:04:10 +0100
parents 86888ae9ce90
children b24e5a708fad
line wrap: on
line diff
--- a/tests/test-hgwebdir.t	Tue Feb 15 01:04:10 2011 +0100
+++ b/tests/test-hgwebdir.t	Tue Feb 15 01:04:10 2011 +0100
@@ -99,6 +99,7 @@
   > rcoll=$root/**
   > star=*
   > starstar=**
+  > astar=webdir/a/*
   > EOF
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-2.log
@@ -130,6 +131,8 @@
   /starstar/webdir/b/
   /starstar/webdir/b/d/
   /starstar/webdir/c/
+  /astar/
+  /astar/.hg/patches/
   
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper'
   200 Script output follows
@@ -322,6 +325,22 @@
   <td class="indexlinks"></td>
   </tr>
   
+  <tr class="parity0">
+  <td><a href="/astar/?style=paper">astar</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/astar/.hg/patches/?style=paper">astar/.hg/patches</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
   </table>
   </div>
   </div>
@@ -470,7 +489,7 @@
   
   a
 
-est [paths] '**' extension
+Test [paths] '**' extension
 
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw'
   200 Script output follows
@@ -486,6 +505,12 @@
   200 Script output follows
   
   d
+
+Test [paths] '*' in a repo root
+
+  $ hg id http://localhost:$HGPORT1/astar
+  8580ff50825a
+
   $ "$TESTDIR/killdaemons.py"
   $ cat > paths.conf <<EOF
   > [paths]