##// END OF EJS Templates
Use python instead of shell printf with \x sequences for test-encoding....
Thomas Arendsen Hein -
r3789:734b1d6b default
parent child Browse files
Show More
@@ -1,38 +1,40
1 #!/bin/sh
1 #!/bin/sh
2
2
3 hg init t
3 hg init t
4 cd t
4 cd t
5
5
6 # we need a repo with some legacy latin-1 changesets
6 # we need a repo with some legacy latin-1 changesets
7 hg unbundle $TESTDIR/legacy-encoding.hg
7 hg unbundle $TESTDIR/legacy-encoding.hg
8 hg co
8 hg co
9
9
10 printf "latin-1 e' encoded: \xe9" > latin-1
10 python << EOF
11 printf "utf-8 e' encoded: \xc3\xa9" > utf-8
11 f = file('latin-1', 'w'); f.write("latin-1 e' encoded: \xe9"); f.close()
12 printf "\xe9" > latin-1-tag
12 f = file('utf-8', 'w'); f.write("utf-8 e' encoded: \xc3\xa9"); f.close()
13 f = file('latin-1-tag', 'w'); f.write("\xe9"); f.close()
14 EOF
13
15
14 echo % should fail with encoding error
16 echo % should fail with encoding error
15 echo "plain old ascii" > a
17 echo "plain old ascii" > a
16 hg st
18 hg st
17 HGENCODING=ascii hg ci -l latin-1 -d "0 0"
19 HGENCODING=ascii hg ci -l latin-1 -d "0 0"
18
20
19 echo % these should work
21 echo % these should work
20 echo "latin-1" > a
22 echo "latin-1" > a
21 HGENCODING=latin-1 hg ci -l latin-1 -d "0 0"
23 HGENCODING=latin-1 hg ci -l latin-1 -d "0 0"
22 echo "utf-8" > a
24 echo "utf-8" > a
23 HGENCODING=utf-8 hg ci -l utf-8 -d "0 0"
25 HGENCODING=utf-8 hg ci -l utf-8 -d "0 0"
24
26
25 HGENCODING=latin-1 hg tag -d "0 0" `cat latin-1-tag`
27 HGENCODING=latin-1 hg tag -d "0 0" `cat latin-1-tag`
26
28
27 echo % ascii
29 echo % ascii
28 hg --encoding ascii log
30 hg --encoding ascii log
29 echo % latin-1
31 echo % latin-1
30 hg --encoding latin-1 log
32 hg --encoding latin-1 log
31 echo % utf-8
33 echo % utf-8
32 hg --encoding utf-8 log
34 hg --encoding utf-8 log
33 echo % ascii
35 echo % ascii
34 HGENCODING=ascii hg tags
36 HGENCODING=ascii hg tags
35 echo % latin-1
37 echo % latin-1
36 HGENCODING=latin-1 hg tags
38 HGENCODING=latin-1 hg tags
37 echo % utf-8
39 echo % utf-8
38 HGENCODING=utf-8 hg tags
40 HGENCODING=utf-8 hg tags
General Comments 0
You need to be logged in to leave comments. Login now