##// END OF EJS Templates
Thomas Arendsen Hein -
r1932:82995896 merge default
parent child Browse files
Show More
@@ -0,0 +1,32 b''
1 #! /usr/bin/env python
2 #
3 # Based on python's Tools/scripts/md5sum.py
4 #
5 # This software may be used and distributed according to the terms
6 # of the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2, which is
7 # GPL-compatible.
8
9 import sys
10 import os
11 import md5
12
13 for filename in sys.argv[1:]:
14 try:
15 fp = open(filename, 'rb')
16 except IOError, msg:
17 sys.stderr.write('%s: Can\'t open: %s\n' % (filename, msg))
18 sys.exit(1)
19
20 m = md5.new()
21 try:
22 while 1:
23 data = fp.read(8192)
24 if not data:
25 break
26 m.update(data)
27 except IOError, msg:
28 sys.stderr.write('%s: I/O error: %s\n' % (filename, msg))
29 sys.exit(1)
30 sys.stdout.write('%s %s\n' % (m.hexdigest(), filename))
31
32 sys.exit(0)
@@ -19,6 +19,9 b' HGEDITOR=true; export HGEDITOR'
19 HGMERGE=true; export HGMERGE
19 HGMERGE=true; export HGMERGE
20 HGUSER="test"; export HGUSER
20 HGUSER="test"; export HGUSER
21
21
22 ECHO_N="echo -n"
23 [ -x /usr/ucb/echo ] && ECHO_N="/usr/ucb/echo -n"
24
22 umask 022
25 umask 022
23
26
24 tests=0
27 tests=0
@@ -40,6 +43,7 b' HGTMP="${TMPDIR-/tmp}/hgtests.$RANDOM.$R'
40 }
43 }
41
44
42 TESTDIR="$PWD"
45 TESTDIR="$PWD"
46 export TESTDIR
43 INST="$HGTMP/install"
47 INST="$HGTMP/install"
44 PYTHONDIR="$INST/lib/python"
48 PYTHONDIR="$INST/lib/python"
45 cd ..
49 cd ..
@@ -109,7 +113,7 b' run_one() {'
109
113
110 # list of prerequisite programs
114 # list of prerequisite programs
111 # stuff from coreutils (cat, rm, etc) are not tested
115 # stuff from coreutils (cat, rm, etc) are not tested
112 prereqs="python merge diff grep unzip md5sum gunzip sed"
116 prereqs="python merge diff grep unzip gunzip sed"
113 missing=''
117 missing=''
114 for pre in $prereqs ; do
118 for pre in $prereqs ; do
115 if type $pre > /dev/null 2>&1 ; then
119 if type $pre > /dev/null 2>&1 ; then
@@ -134,7 +138,7 b' if [ -z "$TESTS" ] ; then'
134 fi
138 fi
135
139
136 for f in $TESTS ; do
140 for f in $TESTS ; do
137 echo -n "."
141 $ECHO_N "."
138 run_one $f || failed=`expr $failed + 1`
142 run_one $f || failed=`expr $failed + 1`
139 tests=`expr $tests + 1`
143 tests=`expr $tests + 1`
140 done
144 done
@@ -29,9 +29,10 b" f = urllib2.urlopen('http://127.0.0.1:20"
29 % (node, archive))
29 % (node, archive))
30 sys.stdout.write(f.read())
30 sys.stdout.write(f.read())
31 EOF
31 EOF
32 http_proxy= python getarchive.py "$TIP" gz | tar tzf - | sed "s/$QTIP/TIP/"
32 http_proxy= python getarchive.py "$TIP" gz | gunzip -dc - | tar tf - | sed "s/$QTIP/TIP/"
33 http_proxy= python getarchive.py "$TIP" bz2 | tar tjf - | sed "s/$QTIP/TIP/"
33 http_proxy= python getarchive.py "$TIP" bz2 | bunzip2 -dc - | tar tf - | sed "s/$QTIP/TIP/"
34 http_proxy= python getarchive.py "$TIP" zip > archive.zip
34 http_proxy= python getarchive.py "$TIP" zip > archive.zip
35 unzip -t archive.zip | sed "s/$QTIP/TIP/"
35 unzip -t archive.zip | sed "s/$QTIP/TIP/"
36
36
37 kill `cat hg.pid`
37 kill `cat hg.pid`
38 sleep 1 # wait for server to scream and die
@@ -19,7 +19,7 b' EOF'
19
19
20 python dumb.py 2>/dev/null &
20 python dumb.py 2>/dev/null &
21
21
22 hg clone http://localhost:20059/foo copy2
22 http_proxy= hg clone http://localhost:20059/foo copy2
23 echo $?
23 echo $?
24
24
25 kill $!
25 kill $!
@@ -16,7 +16,7 b' hg verify'
16 # No update
16 # No update
17 hg clone -U . ../c
17 hg clone -U . ../c
18 cd ../c
18 cd ../c
19 cat a
19 cat a 2>/dev/null || echo "a not present"
20 hg verify
20 hg verify
21
21
22 # Default destination
22 # Default destination
@@ -4,7 +4,7 b' checking manifests'
4 crosschecking files in changesets and manifests
4 crosschecking files in changesets and manifests
5 checking files
5 checking files
6 1 files, 1 changesets, 1 total revisions
6 1 files, 1 changesets, 1 total revisions
7 cat: a: No such file or directory
7 a not present
8 checking changesets
8 checking changesets
9 checking manifests
9 checking manifests
10 crosschecking files in changesets and manifests
10 crosschecking files in changesets and manifests
@@ -12,5 +12,5 b' hg commit -m branch2 -d "0 0"'
12 HGMERGE=merge; export HGMERGE
12 HGMERGE=merge; export HGMERGE
13 hg up -m 1
13 hg up -m 1
14 hg id
14 hg id
15 grep -Ev ">>>|<<<" a
15 egrep -v ">>>|<<<" a
16 hg status
16 hg status
@@ -20,11 +20,11 b' echo "this should show a revision linked'
20 hg debugindex .hg/data/b.i
20 hg debugindex .hg/data/b.i
21
21
22 echo "this should show the rename information in the metadata"
22 echo "this should show the rename information in the metadata"
23 hg debugdata .hg/data/b.d 0 | head -n 3 | tail -n 2
23 hg debugdata .hg/data/b.d 0 | head -3 | tail -2
24
24
25 md5sum .hg/data/b.d
25 $TESTDIR/md5sum.py .hg/data/b.d
26 hg cat b > bsum
26 hg cat b > bsum
27 md5sum bsum
27 $TESTDIR/md5sum.py bsum
28 hg cat a > asum
28 hg cat a > asum
29 md5sum asum
29 $TESTDIR/md5sum.py asum
30 hg verify
30 hg verify
@@ -10,7 +10,7 b' hg add sub/b'
10 hg commit -m "second" -d "0 0" sub/b
10 hg commit -m "second" -d "0 0" sub/b
11 cat sub/b
11 cat sub/b
12 hg co 0
12 hg co 0
13 cat sub/b
13 cat sub/b 2>/dev/null || echo "sub/b not present"
14 ls sub
14 ls sub 2>/dev/null || echo "sub not present"
15
15
16 true
16 true
@@ -1,3 +1,3 b''
1 321
1 321
2 cat: sub/b: No such file or directory
2 sub/b not present
3 ls: sub: No such file or directory
3 sub not present
@@ -30,5 +30,5 b' hg history'
30 hg -v co -m
30 hg -v co -m
31
31
32 ls -l ../test[12]/a > foo
32 ls -l ../test[12]/a > foo
33 cut -b 0-10 < foo
33 cut -b 1-10 < foo
34
34
@@ -10,7 +10,7 b' hg verify'
10 hg serve -p 20059 -d --pid-file=hg.pid
10 hg serve -p 20059 -d --pid-file=hg.pid
11 cd ..
11 cd ..
12
12
13 hg clone http://localhost:20059/ copy
13 http_proxy= hg clone http://localhost:20059/ copy
14 cd copy
14 cd copy
15 hg verify
15 hg verify
16 hg co
16 hg co
@@ -1,7 +1,8 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 http_proxy= hg clone old-http://localhost:20059/ copy
3 http_proxy= hg clone old-http://localhost:20059/ copy > clonefail.out 2>&1
4 echo $?
4 echo $?
5 sed 's/[0-9]//g' < clonefail.out
5 ls copy
6 ls copy
6
7
7 # This server doesn't do range requests so it's basically only good for
8 # This server doesn't do range requests so it's basically only good for
@@ -1,5 +1,5 b''
1 255
1 abort: Connection refused
2 abort: Connection refused
2 255
3 ls: copy: No such file or directory
3 ls: copy: No such file or directory
4 changeset: 0:61c9426e69fe
4 changeset: 0:61c9426e69fe
5 tag: tip
5 tag: tip
General Comments 0
You need to be logged in to leave comments. Login now