Mercurial > hg
view tests/test-hgwebdir.t @ 42044:bb271ec2fbfb
compression: introduce a `storage.revlog.zstd.level` configuration
This option control the zstd compression level used when compressing revlog
chunk. The usage of zstd for revlog compression has not graduated from
experimental yet, but we intend to fix that soon.
The option name for the compression level is more straight forward to pick, so
this changesets comes first. Having a dedicated option for each compression
engine is useful because they don't support the same range of values.
I ran the same measurement as for the zlib compression level (in the parent
changesets). The variation in repository size is stay mostly in the same (small)
range. The "read/write" performance see smallish variation, but are overall much
better than zlib. Write performance show the same tend of having better write
performance for when reaching high-end compression.
Again, we don't intend to change the default zstd compression level (currently:
3) in this series. However this is worth investigating in the future.
The Performance comparison of zlib vs zstd is quite impressive. The repository
size stay in the same range, but the performance are much better in all
situations.
Comparison summary
==================
We are looking at:
- performance range for zlib
- performance range for zstd
- comparison of default zstd (level-3) to default zlib (level 6)
- comparison of the slowest zstd time to the fastest zlib time
Read performance:
-----------------
| zlib | zstd | cmp | f2s
mercurial | 0.170159 - 0.189219 | 0.144127 - 0.149624 | 80% | 88%
pypy | 2.679217 - 2.768691 | 1.532317 - 1.705044 | 60% | 63%
netbeans | 122.477027 - 141.620281 | 72.996346 - 89.731560 | 58% | 73%
mozilla | 147.867662 - 170.572118 | 91.700995 - 105.853099 | 56% | 71%
Write performance:
------------------
| zlib | zstd | cmp | f2s
mercurial | 53.250304 - 56.2936129 | 40.877025 - 45.677286 | 75% | 86%
pypy | 460.721984 - 476.589918 | 270.545409 - 301.002219 | 63% | 65%
netbeans | 520.560316 - 715.930400 | 370.356311 - 428.329652 | 55% | 82%
mozilla | 739.803002 - 987.056093 | 505.152906 - 591.930683 | 57% | 80%
Raw data
--------
repo alg lvl .hg/store size 00manifest.d read write
mercurial zlib 1 49,402,813 5,963,475 0.170159 53.250304
mercurial zlib 6 47,197,397 5,875,730 0.182820 56.264320
mercurial zlib 9 47,121,596 5,849,781 0.189219 56.293612
mercurial zstd 1 49,737,084 5,966,355 0.144127 40.877025
mercurial zstd 3 48,961,867 5,895,208 0.146376 42.268142
mercurial zstd 5 48,200,592 5,938,676 0.149624 43.162875
mercurial zstd 10 47,833,520 5,913,353 0.145185 44.012489
mercurial zstd 15 47,314,604 5,728,679 0.147686 45.677286
mercurial zstd 20 47,330,502 5,830,539 0.145789 45.025407
mercurial zstd 22 47,330,076 5,830,539 0.143996 44.690460
pypy zlib 1 370,830,572 28,462,425 2.679217 460.721984
pypy zlib 6 340,112,317 27,648,747 2.768691 467.537158
pypy zlib 9 338,360,736 27,639,003 2.763495 476.589918
pypy zstd 1 362,377,479 27,916,214 1.532317 270.545409
pypy zstd 3 354,137,693 27,905,988 1.686718 294.951509
pypy zstd 5 342,640,043 27,655,774 1.705044 301.002219
pypy zstd 10 334,224,327 27,164,493 1.567287 285.186239
pypy zstd 15 329,000,363 26,645,965 1.637729 299.561332
pypy zstd 20 324,534,039 26,199,547 1.526813 302.149827
pypy zstd 22 324,530,595 26,198,932 1.525718 307.821218
netbeans zlib 1 1,281,847,810 165,495,457 122.477027 520.560316
netbeans zlib 6 1,205,284,353 159,161,207 139.876147 715.930400
netbeans zlib 9 1,197,135,671 155,034,586 141.620281 678.297064
netbeans zstd 1 1,259,581,737 160,840,613 72.996346 370.356311
netbeans zstd 3 1,232,978,122 157,691,551 81.622317 396.733087
netbeans zstd 5 1,208,034,075 160,246,880 83.080549 364.342626
netbeans zstd 10 1,188,624,176 156,083,417 79.323935 403.594602
netbeans zstd 15 1,176,973,589 153,859,477 89.731560 428.329652
netbeans zstd 20 1,162,958,258 151,147,535 82.842667 392.335349
netbeans zstd 22 1,162,707,029 151,150,220 82.565695 402.840655
mozilla zlib 1 2,775,497,186 298,527,987 147.867662 751.263721
mozilla zlib 6 2,596,856,420 286,597,671 170.572118 987.056093
mozilla zlib 9 2,587,542,494 287,018,264 163.622338 739.803002
mozilla zstd 1 2,723,159,348 286,617,532 91.700995 570.042751
mozilla zstd 3 2,665,055,001 286,152,013 95.240155 561.412805
mozilla zstd 5 2,607,819,817 288,060,030 101.978048 505.152906
mozilla zstd 10 2,558,761,085 283,967,648 104.113481 497.771202
mozilla zstd 15 2,526,216,060 275,581,300 105.853099 591.930683
mozilla zstd 20 2,485,114,806 266,478,859 95.268795 576.515389
mozilla zstd 22 2,484,869,080 266,456,505 94.429282 572.785537
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 27 Mar 2019 18:35:59 +0100 |
parents | 15e8250a82da |
children | 6fc57680cfd6 |
line wrap: on
line source
#require serve hide outer repo and work in dir without '.hg' $ hg init $ mkdir dir $ cd dir Tests some basic hgwebdir functionality. Tests setting up paths and collection, different forms of 404s and the subdirectory support. $ mkdir webdir $ cd webdir $ hg init a $ echo a > a/a $ hg --cwd a ci -Ama -d'1 0' adding a create a mercurial queue repository $ hg --cwd a qinit --config extensions.hgext.mq= -c $ hg init b $ echo b > b/b $ hg --cwd b ci -Amb -d'2 0' adding b create a nested repository $ cd b $ hg init d $ echo d > d/d $ hg --cwd d ci -Amd -d'3 0' adding d $ cd .. $ hg init c $ echo c > c/c $ hg --cwd c ci -Amc -d'3 0' adding c create a subdirectory containing repositories and subrepositories $ mkdir notrepo $ cd notrepo $ hg init e $ echo e > e/e $ hg --cwd e ci -Ame -d'4 0' adding e $ hg init e/e2 $ echo e2 > e/e2/e2 $ hg --cwd e/e2 ci -Ame2 -d '4 0' adding e2 $ hg init f $ echo f > f/f $ hg --cwd f ci -Amf -d'4 0' adding f $ hg init f/f2 $ echo f2 > f/f2/f2 $ hg --cwd f/f2 ci -Amf2 -d '4 0' adding f2 $ echo 'f2 = f2' > f/.hgsub $ hg -R f ci -Am 'add subrepo' -d'4 0' adding .hgsub $ cat >> f/.hg/hgrc << EOF > [web] > name = fancy name for repo f > labels = foo, bar > EOF $ cd .. add file under the directory which could be shadowed by another repository $ mkdir notrepo/f/f3 $ echo f3/file > notrepo/f/f3/file $ hg -R notrepo/f ci -Am 'f3/file' adding f3/file $ hg -R notrepo/f update null 0 files updated, 0 files merged, 4 files removed, 0 files unresolved $ hg init notrepo/f/f3 $ cat <<'EOF' > notrepo/f/f3/.hg/hgrc > [web] > hidden = true > EOF create repository without .hg/store $ hg init nostore $ rm -R nostore/.hg/store $ root=`pwd` $ cd .. serve $ cat > paths.conf <<EOF > [paths] > a=$root/a > b=$root/b > EOF $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-1.log $ cat hg.pid >> $DAEMON_PIDS should give a 404 - file does not exist $ get-with-headers.py localhost:$HGPORT 'a/file/tip/bork?style=raw' 404 Not Found error: bork@8580ff50825a: not found in manifest [1] should succeed $ get-with-headers.py localhost:$HGPORT '?style=raw' 200 Script output follows /a/ /b/ $ get-with-headers.py localhost:$HGPORT '?style=json' 200 Script output follows { "entries": [{ "name": "a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }] } (no-eol) $ get-with-headers.py localhost:$HGPORT 'a/file/tip/a?style=raw' 200 Script output follows a $ get-with-headers.py localhost:$HGPORT 'b/file/tip/b?style=raw' 200 Script output follows b should give a 404 - repo is not published $ get-with-headers.py localhost:$HGPORT 'c/file/tip/c?style=raw' 404 Not Found error: repository c/file/tip/c not found [1] atom-log without basedir $ get-with-headers.py localhost:$HGPORT 'a/atom-log' | grep '<link' <link rel="self" href="http://*:$HGPORT/a/atom-log"/> (glob) <link rel="alternate" href="http://*:$HGPORT/a/"/> (glob) <link href="http://*:$HGPORT/a/rev/8580ff50825a"/> (glob) rss-log without basedir $ get-with-headers.py localhost:$HGPORT 'a/rss-log' | grep '<guid' <guid isPermaLink="true">http://*:$HGPORT/a/rev/8580ff50825a</guid> (glob) $ cat > paths.conf <<EOF > [paths] > t/a/=$root/a > b=$root/b > coll=$root/* > 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 $ cat hg.pid >> $DAEMON_PIDS should succeed, slashy names $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /t/a/ /b/ /coll/a/ /coll/a/.hg/patches/ /coll/b/ /coll/c/ /coll/notrepo/e/ /coll/notrepo/f/ /rcoll/a/ /rcoll/a/.hg/patches/ /rcoll/b/ /rcoll/b/d/ /rcoll/c/ /rcoll/notrepo/e/ /rcoll/notrepo/e/e2/ /rcoll/notrepo/f/ /rcoll/notrepo/f/f2/ /star/webdir/a/ /star/webdir/a/.hg/patches/ /star/webdir/b/ /star/webdir/c/ /star/webdir/notrepo/e/ /star/webdir/notrepo/f/ /starstar/webdir/a/ /starstar/webdir/a/.hg/patches/ /starstar/webdir/b/ /starstar/webdir/b/d/ /starstar/webdir/c/ /starstar/webdir/notrepo/e/ /starstar/webdir/notrepo/e/e2/ /starstar/webdir/notrepo/f/ /starstar/webdir/notrepo/f/f2/ /astar/ /astar/.hg/patches/ $ get-with-headers.py localhost:$HGPORT1 '?style=json' 200 Script output follows { "entries": [{ "name": "t/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/a/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/c", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/notrepo/e", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "fancy name for repo f", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": ["foo", "bar"] }, { "name": "rcoll/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/a/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/b/d", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/c", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/notrepo/e", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/notrepo/e/e2", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "fancy name for repo f", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": ["foo", "bar"] }, { "name": "rcoll/notrepo/f/f2", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/a/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/c", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/notrepo/e", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "fancy name for repo f", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": ["foo", "bar"] }, { "name": "starstar/webdir/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/a/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/b/d", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/c", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/notrepo/e", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/notrepo/e/e2", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "fancy name for repo f", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": ["foo", "bar"] }, { "name": "starstar/webdir/notrepo/f/f2", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "astar", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "astar/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }] } (no-eol) $ get-with-headers.py localhost:$HGPORT1 '?style=paper' 200 Script output follows <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> <head> <link rel="icon" href="/static/hgicon.png" type="image/png" /> <meta name="robots" content="index, nofollow" /> <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> <script type="text/javascript" src="/static/mercurial.js"></script> <title>Mercurial repositories index</title> </head> <body> <div class="container"> <div class="menu"> <a href="https://mercurial-scm.org/"> <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a> </div> <div class="main"> <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> <table class="bigtable"> <thead> <tr> <th><a href="?sort=name">Name</a></th> <th><a href="?sort=description">Description</a></th> <th><a href="?sort=contact">Contact</a></th> <th><a href="?sort=lastchange">Last modified</a></th> <th> </th> <th> </th> </tr> </thead> <tbody class="stripes2"> <tr> <td><a href="/t/a/?style=paper">t/a</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/t/a/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/b/?style=paper">b</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/b/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/coll/a/?style=paper">coll/a</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/coll/a/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/coll/a/.hg/patches/?style=paper">coll/a/.hg/patches</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/coll/a/.hg/patches/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/coll/b/?style=paper">coll/b</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/coll/b/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/coll/c/?style=paper">coll/c</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/coll/c/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/coll/notrepo/e/?style=paper">coll/notrepo/e</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/coll/notrepo/e/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/coll/notrepo/f/?style=paper">fancy name for repo f</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/coll/notrepo/f/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/rcoll/a/?style=paper">rcoll/a</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/rcoll/a/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/rcoll/a/.hg/patches/?style=paper">rcoll/a/.hg/patches</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/rcoll/a/.hg/patches/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/rcoll/b/?style=paper">rcoll/b</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/rcoll/b/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/rcoll/b/d/?style=paper">rcoll/b/d</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/rcoll/b/d/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/rcoll/c/?style=paper">rcoll/c</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/rcoll/c/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/rcoll/notrepo/e/?style=paper">rcoll/notrepo/e</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/rcoll/notrepo/e/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/rcoll/notrepo/e/e2/?style=paper">rcoll/notrepo/e/e2</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/rcoll/notrepo/e/e2/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/rcoll/notrepo/f/?style=paper">fancy name for repo f</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/rcoll/notrepo/f/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/rcoll/notrepo/f/f2/?style=paper">rcoll/notrepo/f/f2</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/rcoll/notrepo/f/f2/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/star/webdir/a/?style=paper">star/webdir/a</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/star/webdir/a/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/star/webdir/a/.hg/patches/?style=paper">star/webdir/a/.hg/patches</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/star/webdir/a/.hg/patches/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/star/webdir/b/?style=paper">star/webdir/b</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/star/webdir/b/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/star/webdir/c/?style=paper">star/webdir/c</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/star/webdir/c/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/star/webdir/notrepo/e/?style=paper">star/webdir/notrepo/e</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/star/webdir/notrepo/e/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/star/webdir/notrepo/f/?style=paper">fancy name for repo f</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/star/webdir/notrepo/f/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/starstar/webdir/a/?style=paper">starstar/webdir/a</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/starstar/webdir/a/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/starstar/webdir/a/.hg/patches/?style=paper">starstar/webdir/a/.hg/patches</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/starstar/webdir/a/.hg/patches/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/starstar/webdir/b/?style=paper">starstar/webdir/b</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/starstar/webdir/b/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/starstar/webdir/b/d/?style=paper">starstar/webdir/b/d</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/starstar/webdir/b/d/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/starstar/webdir/c/?style=paper">starstar/webdir/c</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/starstar/webdir/c/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/starstar/webdir/notrepo/e/?style=paper">starstar/webdir/notrepo/e</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/starstar/webdir/notrepo/e/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/starstar/webdir/notrepo/e/e2/?style=paper">starstar/webdir/notrepo/e/e2</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/starstar/webdir/notrepo/e/e2/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/starstar/webdir/notrepo/f/?style=paper">fancy name for repo f</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/starstar/webdir/notrepo/f/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/starstar/webdir/notrepo/f/f2/?style=paper">starstar/webdir/notrepo/f/f2</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/starstar/webdir/notrepo/f/f2/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/astar/?style=paper">astar</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/astar/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> <tr> <td><a href="/astar/.hg/patches/?style=paper">astar/.hg/patches</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/astar/.hg/patches/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> </tbody> </table> </div> </div> </body> </html> $ get-with-headers.py localhost:$HGPORT1 't?style=raw' 200 Script output follows /t/a/ $ get-with-headers.py localhost:$HGPORT1 't/?style=raw' 200 Script output follows /t/a/ $ get-with-headers.py localhost:$HGPORT1 't/?style=paper' 200 Script output follows <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> <head> <link rel="icon" href="/static/hgicon.png" type="image/png" /> <meta name="robots" content="index, nofollow" /> <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> <script type="text/javascript" src="/static/mercurial.js"></script> <title>Mercurial repositories index</title> </head> <body> <div class="container"> <div class="menu"> <a href="https://mercurial-scm.org/"> <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a> </div> <div class="main"> <h2 class="breadcrumb"><a href="/">Mercurial</a> > <a href="/t">t</a> </h2> <table class="bigtable"> <thead> <tr> <th><a href="?sort=name">Name</a></th> <th><a href="?sort=description">Description</a></th> <th><a href="?sort=contact">Contact</a></th> <th><a href="?sort=lastchange">Last modified</a></th> <th> </th> <th> </th> </tr> </thead> <tbody class="stripes2"> <tr> <td><a href="/t/a/?style=paper">a</a></td> <td>unknown</td> <td>Foo Bar <foo.bar@example.com></td> <td class="age">*</td> (glob) <td class="indexlinks"></td> <td> <a href="/t/a/atom-log" title="subscribe to repository atom feed"> <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="subscribe to repository atom feed"> </a> </td> </tr> </tbody> </table> </div> </div> </body> </html> $ get-with-headers.py localhost:$HGPORT1 't/a?style=atom' 200 Script output follows <?xml version="1.0" encoding="ascii"?> <feed xmlns="http://www.w3.org/2005/Atom"> <!-- Changelog --> <id>http://*:$HGPORT1/t/a/</id> (glob) <link rel="self" href="http://*:$HGPORT1/t/a/atom-log"/> (glob) <link rel="alternate" href="http://*:$HGPORT1/t/a/"/> (glob) <title>t/a Changelog</title> <updated>1970-01-01T00:00:01+00:00</updated> <entry> <title>[default] a</title> <id>http://*:$HGPORT1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id> (glob) <link href="http://*:$HGPORT1/t/a/rev/8580ff50825a"/> (glob) <author> <name>test</name> <email>test</email> </author> <updated>1970-01-01T00:00:01+00:00</updated> <published>1970-01-01T00:00:01+00:00</published> <content type="xhtml"> <table xmlns="http://www.w3.org/1999/xhtml"> <tr> <th style="text-align:left;">changeset</th> <td>8580ff50825a</td> </tr> <tr> <th style="text-align:left;">branch</th> <td>default</td> </tr> <tr> <th style="text-align:left;">bookmark</th> <td></td> </tr> <tr> <th style="text-align:left;">tag</th> <td>tip</td> </tr> <tr> <th style="text-align:left;">user</th> <td>test</td> </tr> <tr> <th style="text-align:left;vertical-align:top;">description</th> <td>a</td> </tr> <tr> <th style="text-align:left;vertical-align:top;">files</th> <td>a<br /></td> </tr> </table> </content> </entry> </feed> $ get-with-headers.py localhost:$HGPORT1 't/a/?style=atom' 200 Script output follows <?xml version="1.0" encoding="ascii"?> <feed xmlns="http://www.w3.org/2005/Atom"> <!-- Changelog --> <id>http://*:$HGPORT1/t/a/</id> (glob) <link rel="self" href="http://*:$HGPORT1/t/a/atom-log"/> (glob) <link rel="alternate" href="http://*:$HGPORT1/t/a/"/> (glob) <title>t/a Changelog</title> <updated>1970-01-01T00:00:01+00:00</updated> <entry> <title>[default] a</title> <id>http://*:$HGPORT1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id> (glob) <link href="http://*:$HGPORT1/t/a/rev/8580ff50825a"/> (glob) <author> <name>test</name> <email>test</email> </author> <updated>1970-01-01T00:00:01+00:00</updated> <published>1970-01-01T00:00:01+00:00</published> <content type="xhtml"> <table xmlns="http://www.w3.org/1999/xhtml"> <tr> <th style="text-align:left;">changeset</th> <td>8580ff50825a</td> </tr> <tr> <th style="text-align:left;">branch</th> <td>default</td> </tr> <tr> <th style="text-align:left;">bookmark</th> <td></td> </tr> <tr> <th style="text-align:left;">tag</th> <td>tip</td> </tr> <tr> <th style="text-align:left;">user</th> <td>test</td> </tr> <tr> <th style="text-align:left;vertical-align:top;">description</th> <td>a</td> </tr> <tr> <th style="text-align:left;vertical-align:top;">files</th> <td>a<br /></td> </tr> </table> </content> </entry> </feed> $ get-with-headers.py localhost:$HGPORT1 't/a/file/tip/a?style=raw' 200 Script output follows a Test [paths] '*' extension $ get-with-headers.py localhost:$HGPORT1 'coll/?style=raw' 200 Script output follows /coll/a/ /coll/a/.hg/patches/ /coll/b/ /coll/c/ /coll/notrepo/e/ /coll/notrepo/f/ $ get-with-headers.py localhost:$HGPORT1 'coll/a/file/tip/a?style=raw' 200 Script output follows a Test [paths] '**' extension $ get-with-headers.py localhost:$HGPORT1 'rcoll/?style=raw' 200 Script output follows /rcoll/a/ /rcoll/a/.hg/patches/ /rcoll/b/ /rcoll/b/d/ /rcoll/c/ /rcoll/notrepo/e/ /rcoll/notrepo/e/e2/ /rcoll/notrepo/f/ /rcoll/notrepo/f/f2/ $ get-with-headers.py localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw' 200 Script output follows d Test collapse = True $ killdaemons.py $ cat >> paths.conf <<EOF > [web] > collapse=true > descend = true > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-3.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 'coll/?style=raw' 200 Script output follows /coll/a/ /coll/a/.hg/patches/ /coll/b/ /coll/c/ /coll/notrepo/ $ get-with-headers.py localhost:$HGPORT1 'coll/a/file/tip/a?style=raw' 200 Script output follows a $ get-with-headers.py localhost:$HGPORT1 'rcoll/?style=raw' 200 Script output follows /rcoll/a/ /rcoll/a/.hg/patches/ /rcoll/b/ /rcoll/b/d/ /rcoll/c/ /rcoll/notrepo/ $ get-with-headers.py localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw' 200 Script output follows d Test intermediate directories Hide the subrepo parent $ cp $root/notrepo/f/.hg/hgrc $root/notrepo/f/.hg/hgrc.bak $ cat >> $root/notrepo/f/.hg/hgrc << EOF > [web] > hidden = True > EOF $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/?style=raw' 200 Script output follows /rcoll/notrepo/e/ /rcoll/notrepo/e/e2/ Subrepo parent not hidden $ mv $root/notrepo/f/.hg/hgrc.bak $root/notrepo/f/.hg/hgrc $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/?style=raw' 200 Script output follows /rcoll/notrepo/e/ /rcoll/notrepo/e/e2/ /rcoll/notrepo/f/ /rcoll/notrepo/f/f2/ Test repositories inside intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/e/file/tip/e?style=raw' 200 Script output follows e Test subrepositories inside intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw' 200 Script output follows f2 Test accessing file that could be shadowed by another repository if the URL path were audited as a working-directory path: $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/file/tip/f3/file?style=raw' 200 Script output follows f3/file Test accessing working-directory file that is shadowed by another repository $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/file/ffffffffffff/f3/file?style=raw' 403 Forbidden error: path 'f3/file' is inside nested repo 'f3' [1] Test accessing invalid paths: $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/file/tip/..?style=raw' 403 Forbidden error: .. not under root '$TESTTMP/dir/webdir/notrepo/f' [1] $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/file/tip/.hg/hgrc?style=raw' 403 Forbidden error: path contains illegal component: .hg/hgrc [1] Test descend = False $ killdaemons.py $ cat >> paths.conf <<EOF > descend=false > 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 $ get-with-headers.py localhost:$HGPORT1 'coll/?style=raw' 200 Script output follows /coll/a/ /coll/b/ /coll/c/ $ get-with-headers.py localhost:$HGPORT1 'coll/a/file/tip/a?style=raw' 200 Script output follows a $ get-with-headers.py localhost:$HGPORT1 'rcoll/?style=raw' 200 Script output follows /rcoll/a/ /rcoll/b/ /rcoll/c/ $ get-with-headers.py localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw' 200 Script output follows d Test intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/?style=raw' 200 Script output follows /rcoll/notrepo/e/ /rcoll/notrepo/f/ Test repositories inside intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/e/file/tip/e?style=raw' 200 Script output follows e Test subrepositories inside intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw' 200 Script output follows f2 Test [paths] '*' in a repo root $ hg id http://localhost:$HGPORT1/astar 8580ff50825a $ killdaemons.py $ cat > paths.conf <<EOF > [paths] > t/a = $root/a > t/b = $root/b > c = $root/c > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-5.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /t/a/ /t/b/ /c/ $ get-with-headers.py localhost:$HGPORT1 't/?style=raw' 200 Script output follows /t/a/ /t/b/ Test collapse = True $ killdaemons.py $ cat >> paths.conf <<EOF > [web] > collapse=true > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-6.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /t/ /c/ $ get-with-headers.py localhost:$HGPORT1 't/?style=raw' 200 Script output follows /t/a/ /t/b/ test descend = False $ killdaemons.py $ cat >> paths.conf <<EOF > descend=false > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-7.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /c/ $ get-with-headers.py localhost:$HGPORT1 't/?style=raw' 200 Script output follows /t/a/ /t/b/ $ 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-8.log $ cat hg.pid >> $DAEMON_PIDS test inexistent and inaccessible repo should be ignored silently $ get-with-headers.py localhost:$HGPORT1 '' 200 Script output follows <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> <head> <link rel="icon" href="/static/hgicon.png" type="image/png" /> <meta name="robots" content="index, nofollow" /> <link rel="stylesheet" href="/static/style-paper.css" type="text/css" /> <script type="text/javascript" src="/static/mercurial.js"></script> <title>Mercurial repositories index</title> </head> <body> <div class="container"> <div class="menu"> <a href="https://mercurial-scm.org/"> <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a> </div> <div class="main"> <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2> <table class="bigtable"> <thead> <tr> <th><a href="?sort=name">Name</a></th> <th><a href="?sort=description">Description</a></th> <th><a href="?sort=contact">Contact</a></th> <th><a href="?sort=lastchange">Last modified</a></th> <th> </th> <th> </th> </tr> </thead> <tbody class="stripes2"> </tbody> </table> </div> </div> </body> </html> test listening address/port specified by web-conf (issue4699): $ killdaemons.py $ cat >> paths.conf <<EOF > [web] > address = localhost > port = $HGPORT1 > EOF $ hg serve -d --pid-file=hg.pid --web-conf paths.conf \ > -A access-paths.log -E error-paths-9.log listening at http://*:$HGPORT1/ (bound to *$LOCALIP*:$HGPORT1) (glob) (?) $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows test --port option overrides web.port: $ killdaemons.py $ hg serve -p $HGPORT2 -d -v --pid-file=hg.pid --web-conf paths.conf \ > -A access-paths.log -E error-paths-10.log listening at http://*:$HGPORT2/ (bound to *$LOCALIP*:$HGPORT2) (glob) (?) $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT2 '?style=raw' 200 Script output follows $ killdaemons.py $ cat > collections.conf <<EOF > [collections] > $root=$root > EOF $ hg serve --config web.baseurl=http://hg.example.com:8080/ -p $HGPORT2 -d \ > --pid-file=hg.pid --webdir-conf collections.conf \ > -A access-collections.log -E error-collections.log $ cat hg.pid >> $DAEMON_PIDS collections: should succeed $ get-with-headers.py localhost:$HGPORT2 '?style=raw' 200 Script output follows /a/ /a/.hg/patches/ /b/ /c/ /notrepo/e/ /notrepo/f/ $ get-with-headers.py localhost:$HGPORT2 'a/file/tip/a?style=raw' 200 Script output follows a $ get-with-headers.py localhost:$HGPORT2 'b/file/tip/b?style=raw' 200 Script output follows b $ get-with-headers.py localhost:$HGPORT2 'c/file/tip/c?style=raw' 200 Script output follows c atom-log with basedir / $ get-with-headers.py localhost:$HGPORT2 'a/atom-log' | grep '<link' <link rel="self" href="http://hg.example.com:8080/a/atom-log"/> <link rel="alternate" href="http://hg.example.com:8080/a/"/> <link href="http://hg.example.com:8080/a/rev/8580ff50825a"/> rss-log with basedir / $ get-with-headers.py localhost:$HGPORT2 'a/rss-log' | grep '<guid' <guid isPermaLink="true">http://hg.example.com:8080/a/rev/8580ff50825a</guid> $ killdaemons.py $ hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \ > --pid-file=hg.pid --webdir-conf collections.conf \ > -A access-collections-2.log -E error-collections-2.log $ cat hg.pid >> $DAEMON_PIDS atom-log with basedir /foo/ $ get-with-headers.py localhost:$HGPORT2 'a/atom-log' | grep '<link' <link rel="self" href="http://hg.example.com:8080/foo/a/atom-log"/> <link rel="alternate" href="http://hg.example.com:8080/foo/a/"/> <link href="http://hg.example.com:8080/foo/a/rev/8580ff50825a"/> rss-log with basedir /foo/ $ get-with-headers.py localhost:$HGPORT2 'a/rss-log' | grep '<guid' <guid isPermaLink="true">http://hg.example.com:8080/foo/a/rev/8580ff50825a</guid> Path refreshing works as expected $ killdaemons.py $ mkdir $root/refreshtest $ hg init $root/refreshtest/a $ cat > paths.conf << EOF > [paths] > / = $root/refreshtest/* > EOF $ hg serve -p $HGPORT1 -d --pid-file hg.pid --webdir-conf paths.conf $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /a/ By default refreshing occurs every 20s and a new repo won't be listed immediately. $ hg init $root/refreshtest/b $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /a/ Restart the server with no refresh interval. New repo should appear immediately. $ killdaemons.py $ cat > paths.conf << EOF > [web] > refreshinterval = -1 > [paths] > / = $root/refreshtest/* > EOF $ hg serve -p $HGPORT1 -d --pid-file hg.pid --webdir-conf paths.conf $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /a/ /b/ $ hg init $root/refreshtest/c $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /a/ /b/ /c/ $ killdaemons.py $ cat > paths.conf << EOF > [paths] > /dir1/a_repo = $root/a > /dir1/a_repo/b_repo = $root/b > /dir1/dir2/index = $root/b > EOF $ hg serve -p $HGPORT1 -d --pid-file hg.pid --webdir-conf paths.conf $ cat hg.pid >> $DAEMON_PIDS $ echo 'index file' > $root/a/index $ hg --cwd $root/a ci -Am 'add index file' adding index $ get-with-headers.py localhost:$HGPORT1 '' | grep 'a_repo' <td><a href="/dir1/a_repo/">dir1/a_repo</a></td> <a href="/dir1/a_repo/atom-log" title="subscribe to repository atom feed"> <td><a href="/dir1/a_repo/b_repo/">dir1/a_repo/b_repo</a></td> <a href="/dir1/a_repo/b_repo/atom-log" title="subscribe to repository atom feed"> $ get-with-headers.py localhost:$HGPORT1 'index' | grep 'a_repo' <td><a href="/dir1/a_repo/">dir1/a_repo</a></td> <a href="/dir1/a_repo/atom-log" title="subscribe to repository atom feed"> <td><a href="/dir1/a_repo/b_repo/">dir1/a_repo/b_repo</a></td> <a href="/dir1/a_repo/b_repo/atom-log" title="subscribe to repository atom feed"> $ get-with-headers.py localhost:$HGPORT1 'dir1' | grep 'a_repo' <td><a href="/dir1/a_repo/">a_repo</a></td> <a href="/dir1/a_repo/atom-log" title="subscribe to repository atom feed"> <td><a href="/dir1/a_repo/b_repo/">a_repo/b_repo</a></td> <a href="/dir1/a_repo/b_repo/atom-log" title="subscribe to repository atom feed"> $ get-with-headers.py localhost:$HGPORT1 'dir1/index' | grep 'a_repo' <td><a href="/dir1/a_repo/">a_repo</a></td> <a href="/dir1/a_repo/atom-log" title="subscribe to repository atom feed"> <td><a href="/dir1/a_repo/b_repo/">a_repo/b_repo</a></td> <a href="/dir1/a_repo/b_repo/atom-log" title="subscribe to repository atom feed"> $ get-with-headers.py localhost:$HGPORT1 'dir1/a_repo' | grep 'a_repo' <link rel="icon" href="/dir1/a_repo/static/hgicon.png" type="image/png" /> <link rel="stylesheet" href="/dir1/a_repo/static/style-paper.css" type="text/css" /> <script type="text/javascript" src="/dir1/a_repo/static/mercurial.js"></script> <title>dir1/a_repo: log</title> href="/dir1/a_repo/atom-log" title="Atom feed for dir1/a_repo" /> href="/dir1/a_repo/rss-log" title="RSS feed for dir1/a_repo" /> <img src="/dir1/a_repo/static/hglogo.png" alt="mercurial" /></a> <li><a href="/dir1/a_repo/graph/tip">graph</a></li> <li><a href="/dir1/a_repo/tags">tags</a></li> <li><a href="/dir1/a_repo/bookmarks">bookmarks</a></li> <li><a href="/dir1/a_repo/branches">branches</a></li> <li><a href="/dir1/a_repo/rev/tip">changeset</a></li> <li><a href="/dir1/a_repo/file/tip">browse</a></li> <li><a href="/dir1/a_repo/help">help</a></li> <a href="/dir1/a_repo/atom-log" title="subscribe to atom feed"> <img class="atom-logo" src="/dir1/a_repo/static/feed-icon-14x14.png" alt="atom feed" /> <h2 class="breadcrumb"><a href="/">Mercurial</a> > <a href="/dir1">dir1</a> > <a href="/dir1/a_repo">a_repo</a> </h2> <form class="search" action="/dir1/a_repo/log"> number or hash, or <a href="/dir1/a_repo/help/revsets">revset expression</a>.</div> <a href="/dir1/a_repo/shortlog/tip?revcount=30">less</a> <a href="/dir1/a_repo/shortlog/tip?revcount=120">more</a> | rev 1: <a href="/dir1/a_repo/shortlog/8580ff50825a">(0)</a> <a href="/dir1/a_repo/shortlog/tip">tip</a> <a href="/dir1/a_repo/rev/71a89161f014">add index file</a> <a href="/dir1/a_repo/rev/8580ff50825a">a</a> <a href="/dir1/a_repo/shortlog/tip?revcount=30">less</a> <a href="/dir1/a_repo/shortlog/tip?revcount=120">more</a> | rev 1: <a href="/dir1/a_repo/shortlog/8580ff50825a">(0)</a> <a href="/dir1/a_repo/shortlog/tip">tip</a> '/dir1/a_repo/shortlog/%next%', $ get-with-headers.py localhost:$HGPORT1 'dir1/a_repo/index' | grep 'a_repo' <h2 class="breadcrumb"><a href="/">Mercurial</a> > <a href="/dir1">dir1</a> > <a href="/dir1/a_repo">a_repo</a> </h2> <td><a href="/dir1/a_repo/b_repo/">b_repo</a></td> <a href="/dir1/a_repo/b_repo/atom-log" title="subscribe to repository atom feed"> Files named 'index' are not blocked $ get-with-headers.py localhost:$HGPORT1 'dir1/a_repo/raw-file/tip/index' 200 Script output follows index file Repos named 'index' take precedence over the index file $ get-with-headers.py localhost:$HGPORT1 'dir1/dir2/index' | grep 'index' <link rel="icon" href="/dir1/dir2/index/static/hgicon.png" type="image/png" /> <meta name="robots" content="index, nofollow" /> <link rel="stylesheet" href="/dir1/dir2/index/static/style-paper.css" type="text/css" /> <script type="text/javascript" src="/dir1/dir2/index/static/mercurial.js"></script> <title>dir1/dir2/index: log</title> href="/dir1/dir2/index/atom-log" title="Atom feed for dir1/dir2/index" /> href="/dir1/dir2/index/rss-log" title="RSS feed for dir1/dir2/index" /> <img src="/dir1/dir2/index/static/hglogo.png" alt="mercurial" /></a> <li><a href="/dir1/dir2/index/graph/tip">graph</a></li> <li><a href="/dir1/dir2/index/tags">tags</a></li> <li><a href="/dir1/dir2/index/bookmarks">bookmarks</a></li> <li><a href="/dir1/dir2/index/branches">branches</a></li> <li><a href="/dir1/dir2/index/rev/tip">changeset</a></li> <li><a href="/dir1/dir2/index/file/tip">browse</a></li> <li><a href="/dir1/dir2/index/help">help</a></li> <a href="/dir1/dir2/index/atom-log" title="subscribe to atom feed"> <img class="atom-logo" src="/dir1/dir2/index/static/feed-icon-14x14.png" alt="atom feed" /> <h2 class="breadcrumb"><a href="/">Mercurial</a> > <a href="/dir1">dir1</a> > <a href="/dir1/dir2">dir2</a> > <a href="/dir1/dir2/index">index</a> </h2> <form class="search" action="/dir1/dir2/index/log"> number or hash, or <a href="/dir1/dir2/index/help/revsets">revset expression</a>.</div> <a href="/dir1/dir2/index/shortlog/tip?revcount=30">less</a> <a href="/dir1/dir2/index/shortlog/tip?revcount=120">more</a> | rev 0: <a href="/dir1/dir2/index/shortlog/39505516671b">(0)</a> <a href="/dir1/dir2/index/shortlog/tip">tip</a> <a href="/dir1/dir2/index/rev/39505516671b">b</a> <a href="/dir1/dir2/index/shortlog/tip?revcount=30">less</a> <a href="/dir1/dir2/index/shortlog/tip?revcount=120">more</a> | rev 0: <a href="/dir1/dir2/index/shortlog/39505516671b">(0)</a> <a href="/dir1/dir2/index/shortlog/tip">tip</a> '/dir1/dir2/index/shortlog/%next%', $ killdaemons.py $ cat > paths.conf << EOF > [paths] > / = $root/a > EOF $ hg serve -p $HGPORT1 -d --pid-file hg.pid --webdir-conf paths.conf $ cat hg.pid >> $DAEMON_PIDS $ hg id http://localhost:$HGPORT1 71a89161f014 $ get-with-headers.py localhost:$HGPORT1 '' | grep 'index' <meta name="robots" content="index, nofollow" /> <a href="/rev/71a89161f014">add index file</a> $ killdaemons.py paths errors 1 $ cat error-paths-1.log paths errors 2 $ cat error-paths-2.log paths errors 3 $ cat error-paths-3.log paths errors 4 $ cat error-paths-4.log paths errors 5 $ cat error-paths-5.log paths errors 6 $ cat error-paths-6.log paths errors 7 $ cat error-paths-7.log paths errors 8 $ cat error-paths-8.log paths errors 9 $ cat error-paths-9.log paths errors 10 $ cat error-paths-10.log collections errors $ cat error-collections.log collections errors 2 $ cat error-collections-2.log