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