##// END OF EJS Templates
archive: test md5 consistency
Brendan Cully -
r4653:ca023b63 default
parent child Browse files
Show More
@@ -1,51 +1,59 b''
1 1 #!/bin/sh
2 2
3 3 mkdir test
4 4 cd test
5 5 hg init
6 6 echo foo>foo
7 hg addremove
8 hg commit -m 1
7 hg commit -Am 1 -d '1 0'
9 8 echo bar>bar
10 hg addremove
11 hg commit -m 2
9 hg commit -Am 2 -d '2 0'
12 10 mkdir baz
13 11 echo bletch>baz/bletch
14 hg addremove
15 hg commit -m 3
12 hg commit -Am 3 -d '1000000000 0'
16 13 echo "[web]" >> .hg/hgrc
17 14 echo "name = test-archive" >> .hg/hgrc
18 15 echo "allow_archive = gz bz2, zip" >> .hg/hgrc
19 16 hg serve -p 20059 -d --pid-file=hg.pid
20 17 cat hg.pid >> $DAEMON_PIDS
21 18
22 19 TIP=`hg id -v | cut -f1 -d' '`
23 20 QTIP=`hg id -q`
24 21 cat > getarchive.py <<EOF
25 22 import sys, urllib2
26 23 node, archive = sys.argv[1:]
27 24 f = urllib2.urlopen('http://127.0.0.1:20059/?cmd=archive;node=%s;type=%s'
28 25 % (node, archive))
29 26 sys.stdout.write(f.read())
30 27 EOF
31 28 http_proxy= python getarchive.py "$TIP" gz | gunzip | tar tf - | sed "s/$QTIP/TIP/"
32 29 http_proxy= python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - | sed "s/$QTIP/TIP/"
33 30 http_proxy= python getarchive.py "$TIP" zip > archive.zip
34 31 unzip -t archive.zip | sed "s/$QTIP/TIP/"
35 32
36 33 hg archive -t tar test.tar
37 34 tar tf test.tar
38 35
39 36 hg archive -t tbz2 -X baz test.tar.bz2
40 37 bunzip2 -dc test.tar.bz2 | tar tf -
41 38
42 39 hg archive -t tgz -p %b-%h test-%h.tar.gz
43 40 gzip -dc test-$QTIP.tar.gz | tar tf - | sed "s/$QTIP/TIP/"
44 41
42 cat > md5check.py <<EOF
43 import md5, sys
44 print md5.md5(file(sys.argv[1], 'rb').read()).hexdigest()
45 EOF
46
47 hg archive -t tgz tip.tar.gz
48 python md5check.py tip.tar.gz
49 sleep 1
50 hg archive -t tgz tip.tar.gz
51 python md5check.py tip.tar.gz
52
45 53 hg archive -t zip -p /illegal test.zip
46 54 hg archive -t zip -p very/../bad test.zip
47 55
48 56 hg archive -t zip -r 2 test.zip
49 57 unzip -t test.zip
50 58
51 59 hg archive -t tar - | tar tf - | sed "s/$QTIP/TIP/"
@@ -1,39 +1,41 b''
1 1 adding foo
2 2 adding bar
3 3 adding baz/bletch
4 4 test-archive-TIP/.hg_archival.txt
5 5 test-archive-TIP/bar
6 6 test-archive-TIP/baz/bletch
7 7 test-archive-TIP/foo
8 8 test-archive-TIP/.hg_archival.txt
9 9 test-archive-TIP/bar
10 10 test-archive-TIP/baz/bletch
11 11 test-archive-TIP/foo
12 12 Archive: archive.zip
13 13 testing: test-archive-TIP/.hg_archival.txt OK
14 14 testing: test-archive-TIP/bar OK
15 15 testing: test-archive-TIP/baz/bletch OK
16 16 testing: test-archive-TIP/foo OK
17 17 No errors detected in compressed data of archive.zip.
18 18 test/.hg_archival.txt
19 19 test/bar
20 20 test/baz/bletch
21 21 test/foo
22 22 test/.hg_archival.txt
23 23 test/bar
24 24 test/foo
25 25 test-TIP/.hg_archival.txt
26 26 test-TIP/bar
27 27 test-TIP/baz/bletch
28 28 test-TIP/foo
29 76ce33f5d5cf8151558e2d9a396c7504
30 76ce33f5d5cf8151558e2d9a396c7504
29 31 abort: archive prefix contains illegal components
30 32 Archive: test.zip
31 33 testing: test/.hg_archival.txt OK
32 34 testing: test/bar OK
33 35 testing: test/baz/bletch OK
34 36 testing: test/foo OK
35 37 No errors detected in compressed data of test.zip.
36 38 test-TIP/.hg_archival.txt
37 39 test-TIP/bar
38 40 test-TIP/baz/bletch
39 41 test-TIP/foo
General Comments 0
You need to be logged in to leave comments. Login now