comparison tests/test-mq-qimport @ 6027:cee68264ed92

mq: qimport must read patches in binary mode
author Patrick Mezard <pmezard@gmail.com>
date Wed, 06 Feb 2008 23:09:13 +0100
parents
children 05ec27530d04
comparison
equal deleted inserted replaced
6019:b70a530bdb93 6027:cee68264ed92
1 #!/bin/sh
2
3 cat > writelines.py <<EOF
4 import sys
5 path = sys.argv[1]
6 args = sys.argv[2:]
7 assert (len(args) % 2) == 0
8
9 f = file(path, 'wb')
10 for i in xrange(len(args)/2):
11 count, s = args[2*i:2*i+2]
12 count = int(count)
13 s = s.decode('string_escape')
14 f.write(s*count)
15 f.close()
16
17 EOF
18
19 echo "[extensions]" >> $HGRCPATH
20 echo "mq=" >> $HGRCPATH
21 echo "[diff]" >> $HGRCPATH
22 echo "git=1" >> $HGRCPATH
23
24 echo % build diff with CRLF
25 hg init repo
26 cd repo
27 python ../writelines.py b 5 'a\n' 5 'a\r\n'
28 hg ci -Am addb
29 python ../writelines.py b 2 'a\n' 10 'b\n' 2 'a\r\n'
30 hg diff > b.diff
31 hg up -C
32 echo % qimport CRLF diff
33 hg qimport b.diff
34 hg qpush
35
36