##// END OF EJS Templates
Added test cases for repo corruption fixed in 2e0a288ca93e (issue132)...
Added test cases for repo corruption fixed in 2e0a288ca93e (issue132) (submitted by Alexis S. L. Carvalho <alexis@cecm.usp.br>)

File last commit:

r1744:385b0649 default
r1785:81ca1a9b default
Show More
test-archive
39 lines | 968 B | text/plain | TextLexer
#!/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
echo "[web]" >> .hg/hgrc
echo "name = test-archive" >> .hg/hgrc
echo "allowzip = true" >> .hg/hgrc
echo "allowgz = true" >> .hg/hgrc
echo "allowbz2 = true" >> .hg/hgrc
serverpid=`mktemp`
hg serve -p 20059 -d --pid-file=$serverpid
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
http_proxy= python getarchive.py "$TIP" gz | tar tzf - | sed "s/$QTIP/TIP/"
http_proxy= python getarchive.py "$TIP" bz2 | tar tjf - | sed "s/$QTIP/TIP/"
http_proxy= python getarchive.py "$TIP" zip > archive.zip
unzip -t archive.zip | sed "s/$QTIP/TIP/"
kill `cat $serverpid`
rm $serverpid