##// END OF EJS Templates
tests: Windows compatibility fixes...
Patrick Mezard -
r7080:a6477aa8 default
parent child Browse files
Show More
@@ -42,6 +42,9 b' def showhelp():'
42 sys.stdout.write(' %-*s %s\n' % (opts_len, first, second))
42 sys.stdout.write(' %-*s %s\n' % (opts_len, first, second))
43
43
44 try:
44 try:
45 for fp in (sys.stdin, sys.stdout, sys.stderr):
46 util.set_binary(fp)
47
45 opts = {}
48 opts = {}
46 try:
49 try:
47 args = fancyopts.fancyopts(sys.argv[1:], options, opts)
50 args = fancyopts.fancyopts(sys.argv[1:], options, opts)
@@ -6,13 +6,20 b''
6 # of the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2, which is
6 # of the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2, which is
7 # GPL-compatible.
7 # GPL-compatible.
8
8
9 import sys
9 import sys, os
10
10
11 try:
11 try:
12 from hashlib import md5
12 from hashlib import md5
13 except ImportError:
13 except ImportError:
14 from md5 import md5
14 from md5 import md5
15
15
16 try:
17 import msvcrt
18 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
19 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
20 except ImportError:
21 pass
22
16 for filename in sys.argv[1:]:
23 for filename in sys.argv[1:]:
17 try:
24 try:
18 fp = open(filename, 'rb')
25 fp = open(filename, 'rb')
@@ -16,6 +16,14 b''
16 import os
16 import os
17 import sys
17 import sys
18
18
19 try:
20 import msvcrt
21 msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
22 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
23 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
24 except ImportError:
25 pass
26
19 exitcode = 0
27 exitcode = 0
20 out = sys.stdout
28 out = sys.stdout
21
29
@@ -46,6 +46,13 b" TIP=`hg id -v | cut -f1 -d' '`"
46 QTIP=`hg id -q`
46 QTIP=`hg id -q`
47 cat > getarchive.py <<EOF
47 cat > getarchive.py <<EOF
48 import os, sys, urllib2
48 import os, sys, urllib2
49 try:
50 # Set stdout to binary mode for win32 platforms
51 import msvcrt
52 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
53 except ImportError:
54 pass
55
49 node, archive = sys.argv[1:]
56 node, archive = sys.argv[1:]
50 f = urllib2.urlopen('http://127.0.0.1:%s/?cmd=archive;node=%s;type=%s'
57 f = urllib2.urlopen('http://127.0.0.1:%s/?cmd=archive;node=%s;type=%s'
51 % (os.environ['HGPORT'], node, archive))
58 % (os.environ['HGPORT'], node, archive))
@@ -4,7 +4,7 b' hg init'
4
4
5 cat > .hg/hgrc <<EOF
5 cat > .hg/hgrc <<EOF
6 [encode]
6 [encode]
7 *.gz = gunzip
7 *.gz = gzip -d
8
8
9 [decode]
9 [decode]
10 *.gz = gzip
10 *.gz = gzip
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" fifo || exit 80
4
3 hg init
5 hg init
4 mkfifo p
6 mkfifo p
5
7
@@ -2,6 +2,14 b''
2
2
3 cat <<EOF > merge
3 cat <<EOF > merge
4 import sys, os
4 import sys, os
5
6 try:
7 import msvcrt
8 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
9 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
10 except ImportError:
11 pass
12
5 print "merging for", os.path.basename(sys.argv[1])
13 print "merging for", os.path.basename(sys.argv[1])
6 EOF
14 EOF
7 HGMERGE="python ../merge"; export HGMERGE
15 HGMERGE="python ../merge"; export HGMERGE
General Comments 0
You need to be logged in to leave comments. Login now