Debian Codegraph @

tests/test-hgwebdirsym.t

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