Show More
@@ -1,49 +1,76 b'' | |||
|
1 | #!/bin/sh | |
|
2 | # Tests whether or not hgwebdir properly handles various symlink topologies. | |
|
3 | ||
|
4 | "$TESTDIR/hghave" symlink || exit 80 | |
|
5 | ||
|
6 | hg init a | |
|
7 | echo a > a/a | |
|
8 | hg --cwd a ci -Ama -d'1 0' | |
|
9 | ||
|
10 | mkdir webdir | |
|
11 | cd webdir | |
|
1 | Tests whether or not hgwebdir properly handles various symlink topologies. | |
|
12 | 2 | |
|
13 | hg init b | |
|
14 | echo b > b/b | |
|
15 | hg --cwd b ci -Amb -d'2 0' | |
|
3 | $ "$TESTDIR/hghave" symlink || exit 80 | |
|
4 | $ hg init a | |
|
5 | $ echo a > a/a | |
|
6 | $ hg --cwd a ci -Ama -d'1 0' | |
|
7 | adding a | |
|
8 | $ mkdir webdir | |
|
9 | $ cd webdir | |
|
10 | $ hg init b | |
|
11 | $ echo b > b/b | |
|
12 | $ hg --cwd b ci -Amb -d'2 0' | |
|
13 | adding b | |
|
14 | $ hg init c | |
|
15 | $ echo c > c/c | |
|
16 | $ hg --cwd c ci -Amc -d'3 0' | |
|
17 | adding c | |
|
18 | $ ln -s ../a al | |
|
19 | $ ln -s ../webdir circle | |
|
20 | $ root=`pwd` | |
|
21 | $ cd .. | |
|
22 | $ cat > collections.conf <<EOF | |
|
23 | > [collections] | |
|
24 | > $root=$root | |
|
25 | > EOF | |
|
26 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \ | |
|
27 | > -A access-collections.log -E error-collections.log | |
|
28 | $ cat hg.pid >> $DAEMON_PIDS | |
|
16 | 29 | |
|
17 | hg init c | |
|
18 | echo c > c/c | |
|
19 | hg --cwd c ci -Amc -d'3 0' | |
|
20 | ||
|
21 | ln -s ../a al | |
|
22 | ln -s ../webdir circle | |
|
23 | ||
|
24 | root=`pwd` | |
|
30 | should succeed | |
|
25 | 31 | |
|
26 | cd .. | |
|
32 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw' | |
|
33 | 200 Script output follows | |
|
34 | ||
|
35 | ||
|
36 | /al/ | |
|
37 | /b/ | |
|
38 | /c/ | |
|
39 | ||
|
40 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/al/file/tip/a?style=raw' | |
|
41 | 200 Script output follows | |
|
42 | ||
|
43 | a | |
|
44 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw' | |
|
45 | 200 Script output follows | |
|
46 | ||
|
47 | b | |
|
48 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw' | |
|
49 | 200 Script output follows | |
|
50 | ||
|
51 | c | |
|
27 | 52 | |
|
28 | cat > collections.conf <<EOF | |
|
29 | [collections] | |
|
30 | $root=$root | |
|
31 | EOF | |
|
32 | ||
|
33 | hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \ | |
|
34 | -A access-collections.log -E error-collections.log | |
|
35 | cat hg.pid >> $DAEMON_PIDS | |
|
53 | should fail | |
|
36 | 54 | |
|
37 | echo % should succeed | |
|
38 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw' | |
|
39 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/al/file/tip/a?style=raw' | |
|
40 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw' | |
|
41 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw' | |
|
55 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/al/file/tip/a?style=raw' | |
|
56 | 404 Not Found | |
|
57 | ||
|
58 | ||
|
59 | error: repository circle not found | |
|
60 | [1] | |
|
61 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/b/file/tip/a?style=raw' | |
|
62 | 404 Not Found | |
|
63 | ||
|
64 | ||
|
65 | error: repository circle not found | |
|
66 | [1] | |
|
67 | $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/c/file/tip/a?style=raw' | |
|
68 | 404 Not Found | |
|
69 | ||
|
70 | ||
|
71 | error: repository circle not found | |
|
72 | [1] | |
|
42 | 73 | |
|
43 | echo % should fail | |
|
44 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/al/file/tip/a?style=raw' | |
|
45 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/b/file/tip/a?style=raw' | |
|
46 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/c/file/tip/a?style=raw' | |
|
74 | collections errors | |
|
47 | 75 | |
|
48 | echo % collections errors | |
|
49 | cat error-collections.log | |
|
76 | $ cat error-collections.log |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now