Mercurial > hg
annotate tests/test-hgwebdir @ 10878:c63a6ddbbf9a stable
test-hgwebdir: correctly include '-' in sed expression.
'\' can't be used to escape '-' from being interpreted as a range,
so put it at the end.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 09 Apr 2010 15:14:43 +0200 |
parents | 6d87c20cd7a8 |
children | 8f8a7976f4bc |
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/** |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
68 EOF |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
69 |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
70 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
|
71 -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
|
72 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
|
73 |
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
74 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
|
75 "$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
|
76 "$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
|
77 | 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
|
78 "$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
|
79 "$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
|
80 "$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
|
81 | 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
|
82 "$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
|
83 | 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
|
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/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
|
87 # Test [paths] '*' extension |
79d1bb737c16
hgweb: extend [paths] syntax to match repositories recursively (issue852)
Patrick Mezard <pmezard@gmail.com>
parents:
7202
diff
changeset
|
88 "$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
|
89 "$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
|
90 #test [paths] '**' extension |
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
91 "$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
|
92 "$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
|
93 |
5578
733b50883f73
Add tests for hgwebdir repository names with slashes in them.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5561
diff
changeset
|
94 |
9363
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
95 "$TESTDIR/killdaemons.py" |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
96 cat > paths.conf <<EOF |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
97 [paths] |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
98 t/a = $root/a |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
99 t/b = $root/b |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
100 c = $root/c |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
101 [web] |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
102 descend=false |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
103 EOF |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
104 |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
105 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
|
106 -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
|
107 cat hg.pid >> $DAEMON_PIDS |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
108 echo % test descend = False |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
109 "$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
|
110 "$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
|
111 |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
112 |
5561
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
113 cat > collections.conf <<EOF |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
114 [collections] |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
115 $root=$root |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
116 EOF |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
117 |
9184
f6eb03027411
Fix issue1679: path reconstruction in hgwebdir was mangling things badly
Bryan O'Sullivan <bos@serpentine.com>
parents:
8245
diff
changeset
|
118 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
|
119 --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
|
120 -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
|
121 cat hg.pid >> $DAEMON_PIDS |
22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
122 |
7523
e60aaae83323
hgweb: recurse down collections only if ** in [paths]
Benoit Allard <benoit@aeteurope.nl>
parents:
7494
diff
changeset
|
123 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
|
124 "$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
|
125 "$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
|
126 "$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
|
127 "$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
|
128 |
10674
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
129 echo % atom-log with basedir / |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
130 "$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
|
131 | 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
|
132 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
133 echo % rss-log with basedir / |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
134 "$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
|
135 | 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
|
136 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
137 "$TESTDIR/killdaemons.py" |
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 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
|
140 --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
|
141 -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
|
142 cat hg.pid >> $DAEMON_PIDS |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
143 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
144 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
|
145 "$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
|
146 | 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
|
147 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
148 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
|
149 "$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
|
150 | 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
|
151 |
5601
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
152 echo % paths errors 1 |
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
153 cat error-paths-1.log |
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
154 echo % paths errors 2 |
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
155 cat error-paths-2.log |
9363
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
156 echo % paths errors 3 |
8635b33eaade
hgweb: add web.descend configuration variable
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9184
diff
changeset
|
157 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
|
158 echo % collections errors |
8279cb841467
hgwebdir: split out makeindex function, facilitate test failure diagnosis
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
5586
diff
changeset
|
159 cat error-collections.log |
10674
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
160 echo % collections errors 2 |
6d87c20cd7a8
hgweb: fix broken URLs of RSS/Atom feeds (issue1772)
Yuya Nishihara <yuya@tcha.org>
parents:
9363
diff
changeset
|
161 cat error-collections-2.log |