comparison tests/test-hgwebdirsym @ 6341:63bdfcc3eaaf

test: Add tests for webdir symlinks and walkrepos.
author Eric Hopper <hopper@omnifarious.org>
date Fri, 21 Mar 2008 08:46:15 -0700
parents
children
comparison
equal deleted inserted replaced
6340:949e607ac544 6341:63bdfcc3eaaf
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
12
13 hg init b
14 echo b > b/b
15 hg --cwd b ci -Amb -d'2 0'
16
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`
25
26 cd ..
27
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
36
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'
42
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'
47
48 echo % collections errors
49 cat error-collections.log