##// END OF EJS Templates
hgweb: make paths wildcards expanding in a repo root match repo correctly...
Mads Kiilerich -
r13403:8ed91088 default
parent child Browse files
Show More
@@ -41,16 +41,14 b' def urlrepos(prefix, roothead, paths):'
41 41 """yield url paths and filesystem paths from a list of repo paths
42 42
43 43 >>> list(urlrepos('hg', '/opt', ['/opt/r', '/opt/r/r', '/opt']))
44 [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg/', '/opt')]
44 [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg', '/opt')]
45 45 >>> list(urlrepos('', '/opt', ['/opt/r', '/opt/r/r', '/opt']))
46 46 [('r', '/opt/r'), ('r/r', '/opt/r/r'), ('', '/opt')]
47 47 """
48 48 for path in paths:
49 49 path = os.path.normpath(path)
50 name = util.pconvert(path[len(roothead):]).strip('/')
51 if prefix:
52 name = prefix + '/' + name
53 yield name, path
50 yield (prefix + '/' +
51 util.pconvert(path[len(roothead):]).lstrip('/')).strip('/'), path
54 52
55 53 class hgwebdir(object):
56 54 refreshinterval = 20
@@ -99,6 +99,7 b' rss-log without basedir'
99 99 > rcoll=$root/**
100 100 > star=*
101 101 > starstar=**
102 > astar=webdir/a/*
102 103 > EOF
103 104 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
104 105 > -A access-paths.log -E error-paths-2.log
@@ -130,6 +131,8 b' should succeed, slashy names'
130 131 /starstar/webdir/b/
131 132 /starstar/webdir/b/d/
132 133 /starstar/webdir/c/
134 /astar/
135 /astar/.hg/patches/
133 136
134 137 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper'
135 138 200 Script output follows
@@ -322,6 +325,22 b' should succeed, slashy names'
322 325 <td class="indexlinks"></td>
323 326 </tr>
324 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>
338 <td>unknown</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>
340 <td class="age">* ago</td> (glob)
341 <td class="indexlinks"></td>
342 </tr>
343
325 344 </table>
326 345 </div>
327 346 </div>
@@ -470,7 +489,7 b" Test [paths] '*' extension"
470 489
471 490 a
472 491
473 est [paths] '**' extension
492 Test [paths] '**' extension
474 493
475 494 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw'
476 495 200 Script output follows
@@ -486,6 +505,12 b" est [paths] '**' extension"
486 505 200 Script output follows
487 506
488 507 d
508
509 Test [paths] '*' in a repo root
510
511 $ hg id http://localhost:$HGPORT1/astar
512 8580ff50825a
513
489 514 $ "$TESTDIR/killdaemons.py"
490 515 $ cat > paths.conf <<EOF
491 516 > [paths]
General Comments 0
You need to be logged in to leave comments. Login now