Mercurial > hg
annotate tests/test-hgwebdir @ 11852:b2f91119bf8c
tests: unify test-annotate
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Sat, 14 Aug 2010 02:18:17 +0200 |
parents | 8f8a7976f4bc |
children | 9617803b1acb |
rev | line source |
---|---|
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
1 #!/bin/sh |
5580
f429e0e067a8
Fix style nit and add some comments to tests.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5578
diff
changeset
|
2 # Tests some basic hgwebdir functionality. Tests setting up paths and |
f429e0e067a8
Fix style nit and add some comments to tests.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5578
diff
changeset
|
3 # collection, different forms of 404s and the subdirectory support. |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
4 |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
5 mkdir webdir |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
6 cd webdir |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
7 |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
8 hg init a |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
9 echo a > a/a |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
10 hg --cwd a ci -Ama -d'1 0' |
7523
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
11 # create a mercurial queue repository |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
12 hg --cwd a qinit --config extensions.hgext.mq= -c |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
13 |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
14 hg init b |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
15 echo b > b/b |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
16 hg --cwd b ci -Amb -d'2 0' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
17 |
7523
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
18 # create a nested repository |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
19 cd b |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
20 hg init d |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
21 echo d > d/d |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
22 hg --cwd d ci -Amd -d'3 0' |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
23 cd .. |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
24 |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
25 hg init c |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
26 echo c > c/c |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
27 hg --cwd c ci -Amc -d'3 0' |
7523
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
28 |
7494
85dc88630beb
util: disable walkrepo() recursive behaviour
Patrick Mezard <pmezard@gmail.com>
parents:
7450
diff
changeset
|
29 root=`pwd` |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
30 cd .. |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
31 |
9363
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
32 |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
33 cat > paths.conf <<EOF |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
34 [paths] |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
35 a=$root/a |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
36 b=$root/b |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
37 EOF |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
38 |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
39 hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \ |
5601
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
40 -A access-paths.log -E error-paths-1.log |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
41 cat hg.pid >> $DAEMON_PIDS |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
42 |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
43 echo % should give a 404 - file does not exist |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
44 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/bork?style=raw' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
45 |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
46 echo % should succeed |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
47 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
48 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/a?style=raw' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
49 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
50 |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
51 echo % should give a 404 - repo is not published |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
52 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw' |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
53 |
10674
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
54 echo % atom-log without basedir |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
55 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/atom-log' \ |
10878
c63a6ddbbf9a
test-hgwebdir: correctly include '-' in sed expression.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
10674
diff
changeset
|
56 | grep '<link' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|' |
10674
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
57 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
58 echo % rss-log without basedir |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
59 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/rss-log' \ |
10878
c63a6ddbbf9a
test-hgwebdir: correctly include '-' in sed expression.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
10674
diff
changeset
|
60 | grep '<guid' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|' |
9363
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
61 |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
62 cat > paths.conf <<EOF |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
63 [paths] |
5586
b90b72729a72
hgwebdir: test virtual paths leading or trailing separators are stripped
Patrick Mezard <pmezard@gmail.com>
parents:
5580
diff
changeset
|
64 t/a/=$root/a |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
65 b=$root/b |
7450
79d1bb737c16
hgweb: extend [paths] syntax to match repositories recursively (issue852)
Patrick Mezard <pmezard@gmail.com>
parents:
7202
diff
changeset
|
66 coll=$root/* |
7523
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
67 rcoll=$root/** |
11677
8f8a7976f4bc
hgwebdir: allow pure relative globs in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10878
diff
changeset
|
68 star=* |
8f8a7976f4bc
hgwebdir: allow pure relative globs in paths
Mads Kiilerich <mads@kiilerich.com>
parents:
10878
diff
changeset
|
69 starstar=** |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
70 EOF |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
71 |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
72 hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ |
5601
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
73 -A access-paths.log -E error-paths-2.log |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
74 cat hg.pid >> $DAEMON_PIDS |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
75 |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
76 echo % should succeed, slashy names |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
77 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw' |
8217
d895158fe8af
tests: add tests for styled hgwebdir pages
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
7523
diff
changeset
|
78 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper' \ |
8245
0eade101f762
Don't use sed -r; instead use old-style regexp
Martijn Pieters <mj@zopatista.com>
parents:
8217
diff
changeset
|
79 | sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/" |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
80 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t?style=raw' |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
81 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw' |
8217
d895158fe8af
tests: add tests for styled hgwebdir pages
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
7523
diff
changeset
|
82 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=paper' \ |
8245
0eade101f762
Don't use sed -r; instead use old-style regexp
Martijn Pieters <mj@zopatista.com>
parents:
8217
diff
changeset
|
83 | sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/" |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
84 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a?style=atom' \ |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
85 | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
86 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/?style=atom' \ |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
87 | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
88 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw' |
7450
79d1bb737c16
hgweb: extend [paths] syntax to match repositories recursively (issue852)
Patrick Mezard <pmezard@gmail.com>
parents:
7202
diff
changeset
|
89 # Test [paths] '*' extension |
79d1bb737c16
hgweb: extend [paths] syntax to match repositories recursively (issue852)
Patrick Mezard <pmezard@gmail.com>
parents:
7202
diff
changeset
|
90 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw' |
79d1bb737c16
hgweb: extend [paths] syntax to match repositories recursively (issue852)
Patrick Mezard <pmezard@gmail.com>
parents:
7202
diff
changeset
|
91 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw' |
7523
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
92 #test [paths] '**' extension |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
93 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw' |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
94 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw' |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
95 |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
96 |
9363
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
97 "$TESTDIR/killdaemons.py" |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
98 cat > paths.conf <<EOF |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
99 [paths] |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
100 t/a = $root/a |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
101 t/b = $root/b |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
102 c = $root/c |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
103 [web] |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
104 descend=false |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
105 EOF |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
106 |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
107 hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
108 -A access-paths.log -E error-paths-3.log |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
109 cat hg.pid >> $DAEMON_PIDS |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
110 echo % test descend = False |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
111 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw' |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
112 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw' |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
113 |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
114 |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
115 cat > collections.conf <<EOF |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
116 [collections] |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
117 $root=$root |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
118 EOF |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
119 |
9184
f6eb03027411
Fix issue1679: path reconstruction in hgwebdir was mangling things badly
Bryan O'Sullivan <bos@serpentine.com>
parents:
8245
diff
changeset
|
120 hg serve --config web.baseurl=http://hg.example.com:8080/ -p $HGPORT2 -d \ |
f6eb03027411
Fix issue1679: path reconstruction in hgwebdir was mangling things badly
Bryan O'Sullivan <bos@serpentine.com>
parents:
8245
diff
changeset
|
121 --pid-file=hg.pid --webdir-conf collections.conf \ |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
122 -A access-collections.log -E error-collections.log |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
123 cat hg.pid >> $DAEMON_PIDS |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
124 |
7523
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
125 echo % collections: should succeed |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
126 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw' |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
127 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw' |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
128 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw' |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
129 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw' |
5601
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
130 |
10674
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
131 echo % atom-log with basedir / |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
132 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' \ |
10878
c63a6ddbbf9a
test-hgwebdir: correctly include '-' in sed expression.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
10674
diff
changeset
|
133 | grep '<link' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|' |
10674
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
134 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
135 echo % rss-log with basedir / |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
136 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' \ |
10878
c63a6ddbbf9a
test-hgwebdir: correctly include '-' in sed expression.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
10674
diff
changeset
|
137 | grep '<guid' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|' |
10674
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
138 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
139 "$TESTDIR/killdaemons.py" |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
140 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
141 hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \ |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
142 --pid-file=hg.pid --webdir-conf collections.conf \ |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
143 -A access-collections-2.log -E error-collections-2.log |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
144 cat hg.pid >> $DAEMON_PIDS |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
145 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
146 echo % atom-log with basedir /foo/ |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
147 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' \ |
10878
c63a6ddbbf9a
test-hgwebdir: correctly include '-' in sed expression.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
10674
diff
changeset
|
148 | grep '<link' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|' |
10674
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
149 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
150 echo % rss-log with basedir /foo/ |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
151 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' \ |
10878
c63a6ddbbf9a
test-hgwebdir: correctly include '-' in sed expression.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
10674
diff
changeset
|
152 | grep '<guid' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|' |
9363
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
153 |
5601
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
154 echo % paths errors 1 |
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
155 cat error-paths-1.log |
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
156 echo % paths errors 2 |
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
157 cat error-paths-2.log |
9363
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
158 echo % paths errors 3 |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
159 cat error-paths-3.log |
5601
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
160 echo % collections errors |
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
161 cat error-collections.log |
10674
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
162 echo % collections errors 2 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
163 cat error-collections-2.log |