comparison 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
comparison
equal deleted inserted replaced
13402:f947d9a4c45c 13403:8ed91088acbb
97 > b=$root/b 97 > b=$root/b
98 > coll=$root/* 98 > coll=$root/*
99 > rcoll=$root/** 99 > rcoll=$root/**
100 > star=* 100 > star=*
101 > starstar=** 101 > starstar=**
102 > astar=webdir/a/*
102 > EOF 103 > EOF
103 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ 104 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
104 > -A access-paths.log -E error-paths-2.log 105 > -A access-paths.log -E error-paths-2.log
105 $ cat hg.pid >> $DAEMON_PIDS 106 $ cat hg.pid >> $DAEMON_PIDS
106 107
128 /starstar/webdir/a/ 129 /starstar/webdir/a/
129 /starstar/webdir/a/.hg/patches/ 130 /starstar/webdir/a/.hg/patches/
130 /starstar/webdir/b/ 131 /starstar/webdir/b/
131 /starstar/webdir/b/d/ 132 /starstar/webdir/b/d/
132 /starstar/webdir/c/ 133 /starstar/webdir/c/
134 /astar/
135 /astar/.hg/patches/
133 136
134 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper' 137 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper'
135 200 Script output follows 138 200 Script output follows
136 139
137 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 140 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
314 <td class="indexlinks"></td> 317 <td class="indexlinks"></td>
315 </tr> 318 </tr>
316 319
317 <tr class="parity1"> 320 <tr class="parity1">
318 <td><a href="/starstar/webdir/c/?style=paper">starstar/webdir/c</a></td> 321 <td><a href="/starstar/webdir/c/?style=paper">starstar/webdir/c</a></td>
322 <td>unknown</td>
323 <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>
324 <td class="age">* ago</td> (glob)
325 <td class="indexlinks"></td>
326 </tr>
327
328 <tr class="parity0">
329 <td><a href="/astar/?style=paper">astar</a></td>
330 <td>unknown</td>
331 <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>
332 <td class="age">* ago</td> (glob)
333 <td class="indexlinks"></td>
334 </tr>
335
336 <tr class="parity1">
337 <td><a href="/astar/.hg/patches/?style=paper">astar/.hg/patches</a></td>
319 <td>unknown</td> 338 <td>unknown</td>
320 <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> 339 <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>
321 <td class="age">* ago</td> (glob) 340 <td class="age">* ago</td> (glob)
322 <td class="indexlinks"></td> 341 <td class="indexlinks"></td>
323 </tr> 342 </tr>
468 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw' 487 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw'
469 200 Script output follows 488 200 Script output follows
470 489
471 a 490 a
472 491
473 est [paths] '**' extension 492 Test [paths] '**' extension
474 493
475 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw' 494 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw'
476 200 Script output follows 495 200 Script output follows
477 496
478 497
484 503
485 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw' 504 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw'
486 200 Script output follows 505 200 Script output follows
487 506
488 d 507 d
508
509 Test [paths] '*' in a repo root
510
511 $ hg id http://localhost:$HGPORT1/astar
512 8580ff50825a
513
489 $ "$TESTDIR/killdaemons.py" 514 $ "$TESTDIR/killdaemons.py"
490 $ cat > paths.conf <<EOF 515 $ cat > paths.conf <<EOF
491 > [paths] 516 > [paths]
492 > t/a = $root/a 517 > t/a = $root/a
493 > t/b = $root/b 518 > t/b = $root/b