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