##// END OF EJS Templates
convert: backout a7492fb2107b...
convert: backout a7492fb2107b This change is brain damaged, there is no reason the copyfrom revision of the project items may have any relevance when deciding the revision parent. It is meaningful only when fetching files content. Incorrect converted graph was spotted in pyglet svn repository at: ------------------------------------------------------------------------ r274 | r1chardj0n3s | 2006-12-21 02:02:14 +0100 (Jeu, 21 Dec 2006) | 2 lines Changed paths: A /branches/richard-glx-version (from /trunk:269) M /branches/richard-glx-version/pyglet/window/xlib/__init__.py R /branches/richard-glx-version/tests/test.py (from /trunk/tests/test.py:270) R /branches/richard-glx-version/tools/info.py (from /trunk/tools/info.py:272) R /branches/richard-glx-version/website/get_involved.php (from /trunk/website/get_involved.php:273) Branching to horribly mangle GLX

File last commit:

r7450:79d1bb73 default
r7476:6644c111 default
Show More
test-hgwebdir
95 lines | 2.7 KiB | text/plain | TextLexer
#!/bin/sh
# Tests some basic hgwebdir functionality. Tests setting up paths and
# collection, different forms of 404s and the subdirectory support.
mkdir webdir
cd webdir
hg init a
echo a > a/a
hg --cwd a ci -Ama -d'1 0'
hg init b
echo b > b/b
hg --cwd b ci -Amb -d'2 0'
hg init c
echo c > c/c
hg --cwd c ci -Amc -d'3 0'
cd b
hg init d
echo d > d/d
hg --cwd d ci -Amd
cd ..
root=`pwd`
cd ..
cat > paths.conf <<EOF
[paths]
a=$root/a
b=$root/b
EOF
hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \
-A access-paths.log -E error-paths-1.log
cat hg.pid >> $DAEMON_PIDS
echo % should give a 404 - file does not exist
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/bork?style=raw'
echo % should succeed
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/a?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw'
echo % should give a 404 - repo is not published
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw'
cat > paths.conf <<EOF
[paths]
t/a/=$root/a
b=$root/b
coll=$root/*
EOF
hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
-A access-paths.log -E error-paths-2.log
cat hg.pid >> $DAEMON_PIDS
echo % should succeed, slashy names
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a?style=atom' \
| sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/?style=atom' \
| sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw'
# Test [paths] '*' extension
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw'
cat > collections.conf <<EOF
[collections]
$root=$root
EOF
hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections.conf \
-A access-collections.log -E error-collections.log
cat hg.pid >> $DAEMON_PIDS
echo % should succeed
"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/d/rev/tip/?style=raw'
echo % paths errors 1
cat error-paths-1.log
echo % paths errors 2
cat error-paths-2.log
echo % collections errors
cat error-collections.log