##// END OF EJS Templates
merge with crew
merge with crew

File last commit:

r1929:85daa4e0 merge default
r1957:29501032 merge default
Show More
test-archive
38 lines | 1000 B | text/plain | TextLexer
Thomas Arendsen Hein
Added test case for zip/gz/bz2 archive downloads.
r1166 #!/bin/sh
mkdir test
cd test
hg init
echo foo>foo
hg addremove
hg commit -m 1
echo bar>bar
hg addremove
hg commit -m 2
mkdir baz
echo bletch>baz/bletch
hg addremove
hg commit -m 3
mpm@selenic.com
hgweb: use ui:username rather than web:contact...
r1260 echo "[web]" >> .hg/hgrc
Thomas Arendsen Hein
Added test case for zip/gz/bz2 archive downloads.
r1166 echo "name = test-archive" >> .hg/hgrc
echo "allowzip = true" >> .hg/hgrc
echo "allowgz = true" >> .hg/hgrc
echo "allowbz2 = true" >> .hg/hgrc
Thomas Arendsen Hein
Don't use mktemp in tests, we're already in a secure temp dir.
r1786 hg serve -p 20059 -d --pid-file=hg.pid
Thomas Arendsen Hein
Added test case for zip/gz/bz2 archive downloads.
r1166
TIP=`hg id -v | cut -f1 -d' '`
QTIP=`hg id -q`
cat > getarchive.py <<EOF
import sys, urllib2
node, archive = sys.argv[1:]
f = urllib2.urlopen('http://127.0.0.1:20059/?cmd=archive;node=%s;type=%s'
% (node, archive))
sys.stdout.write(f.read())
EOF
Peter van Dijk
small solaris portability fixes from John Levon <levon@movementarian.org>
r1925 http_proxy= python getarchive.py "$TIP" gz | gunzip -dc - | tar tf - | sed "s/$QTIP/TIP/"
http_proxy= python getarchive.py "$TIP" bz2 | bunzip2 -dc - | tar tf - | sed "s/$QTIP/TIP/"
Thomas Arendsen Hein
Added test case for zip/gz/bz2 archive downloads.
r1166 http_proxy= python getarchive.py "$TIP" zip > archive.zip
unzip -t archive.zip | sed "s/$QTIP/TIP/"
Thomas Arendsen Hein
Don't use mktemp in tests, we're already in a secure temp dir.
r1786 kill `cat hg.pid`
Peter van Dijk
fix testsuite for freebsd and one timingissue
r1923 sleep 1 # wait for server to scream and die