tests/test-archive
changeset 4804 beb774707c52
parent 4653 ca023b63ba1f
child 4853 6dc0094c0827
child 4867 0e2d0a78f81a
equal deleted inserted replaced
4803:7db38bfb307e 4804:beb774707c52
    37 bunzip2 -dc test.tar.bz2 | tar tf -
    37 bunzip2 -dc test.tar.bz2 | tar tf -
    38 
    38 
    39 hg archive -t tgz -p %b-%h test-%h.tar.gz
    39 hg archive -t tgz -p %b-%h test-%h.tar.gz
    40 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/"
    41 
    41 
    42 cat > md5check.py <<EOF
    42 cat > md5comp.py <<EOF
    43 import md5, sys
    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 EOF
    48 EOF
    46 
    49 
       
    50 # archive name is stored in the archive, so create similar
       
    51 # archives and rename them afterwards.
    47 hg archive -t tgz tip.tar.gz
    52 hg archive -t tgz tip.tar.gz
    48 python md5check.py tip.tar.gz
    53 mv tip.tar.gz tip1.tar.gz
    49 sleep 1
    54 sleep 1
    50 hg archive -t tgz tip.tar.gz
    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 hg archive -t zip -p /illegal test.zip
    59 hg archive -t zip -p /illegal test.zip
    54 hg archive -t zip -p very/../bad test.zip
    60 hg archive -t zip -p very/../bad test.zip
    55 
    61 
    56 hg archive -t zip -r 2 test.zip
    62 hg archive -t zip -r 2 test.zip