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