Add tests for hgwebdir repository names with slashes in them.

This commit is contained in:
Dirkjan Ochtman 2007-12-01 19:10:00 +01:00
parent 9851dc942e
commit 2aa00c9c81
2 changed files with 103 additions and 5 deletions

View File

@ -39,17 +39,37 @@ echo % should succeed
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
EOF
hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
-A access-paths.log -E error-paths.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'
cat > collections.conf <<EOF
[collections]
$root=$root
EOF
hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf collections.conf \
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:$HGPORT1 '/?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/a/file/tip/a?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/b/file/tip/b?style=raw'
"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/c/file/tip/c?style=raw'
"$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'

View File

@ -24,6 +24,84 @@ b
error: repository c not found
% should succeed, slashy names
200 Script output follows
/b/
/t/a/
200 Script output follows
/t/a/
200 Script output follows
/t/a/
200 Script output follows
<?xml version="1.0" encoding="ascii"?>
<feed xmlns="http://127.0.0.1/2005/Atom">
<!-- Changelog -->
<id>http://127.0.0.1/t/a/</id>
<link rel="self" href="http://127.0.0.1/t/a/atom-log"/>
<link rel="alternate" href="http://127.0.0.1/t/a/"/>
<title>t/a Changelog</title>
<updated>1970-01-01T00:00:01+00:00</updated>
<entry>
<title>a</title>
<id>http://127.0.0.1/mercurial/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id>
<link href="http://127.0.0.1/t/a/rev/8580ff50825a50c8f716709acdf8de0deddcd6ab"/>
<author>
<name>test</name>
<email>&#116;&#101;&#115;&#116;</email>
</author>
<updated>1970-01-01T00:00:01+00:00</updated>
<published>1970-01-01T00:00:01+00:00</published>
<content type="xhtml">
<div xmlns="http://127.0.0.1/1999/xhtml">
<pre xml:space="preserve">a</pre>
</div>
</content>
</entry>
</feed>
200 Script output follows
<?xml version="1.0" encoding="ascii"?>
<feed xmlns="http://127.0.0.1/2005/Atom">
<!-- Changelog -->
<id>http://127.0.0.1/t/a/</id>
<link rel="self" href="http://127.0.0.1/t/a/atom-log"/>
<link rel="alternate" href="http://127.0.0.1/t/a/"/>
<title>t/a Changelog</title>
<updated>1970-01-01T00:00:01+00:00</updated>
<entry>
<title>a</title>
<id>http://127.0.0.1/mercurial/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id>
<link href="http://127.0.0.1/t/a/rev/8580ff50825a50c8f716709acdf8de0deddcd6ab"/>
<author>
<name>test</name>
<email>&#116;&#101;&#115;&#116;</email>
</author>
<updated>1970-01-01T00:00:01+00:00</updated>
<published>1970-01-01T00:00:01+00:00</published>
<content type="xhtml">
<div xmlns="http://127.0.0.1/1999/xhtml">
<pre xml:space="preserve">a</pre>
</div>
</content>
</entry>
</feed>
200 Script output follows
a
% should succeed
200 Script output follows