1 #!/bin/sh |
|
2 |
|
3 hg init t |
|
4 cd t |
|
5 |
|
6 # we need a repo with some legacy latin-1 changesets |
|
7 hg unbundle $TESTDIR/legacy-encoding.hg |
|
8 hg co |
|
9 |
|
10 python << EOF |
|
11 f = file('latin-1', 'w'); f.write("latin-1 e' encoded: \xe9"); f.close() |
|
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 |
|
15 |
|
16 echo % should fail with encoding error |
|
17 echo "plain old ascii" > a |
|
18 hg st |
|
19 HGENCODING=ascii hg ci -l latin-1 |
|
20 |
|
21 echo % these should work |
|
22 echo "latin-1" > a |
|
23 HGENCODING=latin-1 hg ci -l latin-1 |
|
24 echo "utf-8" > a |
|
25 HGENCODING=utf-8 hg ci -l utf-8 |
|
26 |
|
27 HGENCODING=latin-1 hg tag `cat latin-1-tag` |
|
28 HGENCODING=latin-1 hg branch `cat latin-1-tag` |
|
29 HGENCODING=latin-1 hg ci -m 'latin1 branch' |
|
30 rm .hg/branch |
|
31 |
|
32 echo "% hg log (ascii)" |
|
33 hg --encoding ascii log |
|
34 echo "% hg log (latin-1)" |
|
35 hg --encoding latin-1 log |
|
36 echo "% hg log (utf-8)" |
|
37 hg --encoding utf-8 log |
|
38 echo "% hg tags (ascii)" |
|
39 HGENCODING=ascii hg tags |
|
40 echo "% hg tags (latin-1)" |
|
41 HGENCODING=latin-1 hg tags |
|
42 echo "% hg tags (utf-8)" |
|
43 HGENCODING=utf-8 hg tags |
|
44 echo "% hg branches (ascii)" |
|
45 HGENCODING=ascii hg branches |
|
46 echo "% hg branches (latin-1)" |
|
47 HGENCODING=latin-1 hg branches |
|
48 echo "% hg branches (utf-8)" |
|
49 HGENCODING=utf-8 hg branches |
|
50 |
|
51 echo '[ui]' >> .hg/hgrc |
|
52 echo 'fallbackencoding = koi8-r' >> .hg/hgrc |
|
53 echo "% hg log (utf-8)" |
|
54 HGENCODING=utf-8 hg log |
|
55 |
|
56 echo "% hg log (dolphin)" |
|
57 HGENCODING=dolphin hg log |
|
58 |
|
59 HGENCODING=ascii hg branch `cat latin-1-tag` |
|
60 cp latin-1-tag .hg/branch |
|
61 HGENCODING=latin-1 hg ci -m 'should fail' |
|
62 exit 0 |
|