Show More
@@ -1,145 +1,145 b'' | |||||
1 | Test alignment of multibyte characters |
|
1 | Test alignment of multibyte characters | |
2 |
|
2 | |||
3 | $ HGENCODING=utf-8 |
|
3 | $ HGENCODING=utf-8 | |
4 | $ export HGENCODING |
|
4 | $ export HGENCODING | |
5 | $ hg init t |
|
5 | $ hg init t | |
6 | $ cd t |
|
6 | $ cd t | |
7 | $ python << EOF |
|
7 | $ python << EOF | |
8 | > # (byte, width) = (6, 4) |
|
8 | > # (byte, width) = (6, 4) | |
9 | > s = "\xe7\x9f\xad\xe5\x90\x8d" |
|
9 | > s = "\xe7\x9f\xad\xe5\x90\x8d" | |
10 | > # (byte, width) = (7, 7): odd width is good for alignment test |
|
10 | > # (byte, width) = (7, 7): odd width is good for alignment test | |
11 | > m = "MIDDLE_" |
|
11 | > m = "MIDDLE_" | |
12 | > # (byte, width) = (18, 12) |
|
12 | > # (byte, width) = (18, 12) | |
13 | > l = "\xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d" |
|
13 | > l = "\xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d" | |
14 | > f = file('s', 'w'); f.write(s); f.close() |
|
14 | > f = file('s', 'w'); f.write(s); f.close() | |
15 | > f = file('m', 'w'); f.write(m); f.close() |
|
15 | > f = file('m', 'w'); f.write(m); f.close() | |
16 | > f = file('l', 'w'); f.write(l); f.close() |
|
16 | > f = file('l', 'w'); f.write(l); f.close() | |
17 | > # instant extension to show list of options |
|
17 | > # instant extension to show list of options | |
18 | > f = file('showoptlist.py', 'w'); f.write("""# encoding: utf-8 |
|
18 | > f = file('showoptlist.py', 'w'); f.write("""# encoding: utf-8 | |
19 | > def showoptlist(ui, repo, *pats, **opts): |
|
19 | > def showoptlist(ui, repo, *pats, **opts): | |
20 | > '''dummy command to show option descriptions''' |
|
20 | > '''dummy command to show option descriptions''' | |
21 | > return 0 |
|
21 | > return 0 | |
22 | > cmdtable = { |
|
22 | > cmdtable = { | |
23 | > 'showoptlist': |
|
23 | > 'showoptlist': | |
24 | > (showoptlist, |
|
24 | > (showoptlist, | |
25 | > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'), |
|
25 | > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'), | |
26 | > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'), |
|
26 | > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'), | |
27 | > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s') |
|
27 | > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s') | |
28 | > ], |
|
28 | > ], | |
29 | > "" |
|
29 | > "" | |
30 | > ) |
|
30 | > ) | |
31 | > } |
|
31 | > } | |
32 | > """ % globals()) |
|
32 | > """ % globals()) | |
33 | > f.close() |
|
33 | > f.close() | |
34 | > EOF |
|
34 | > EOF | |
35 | $ S=`cat s` |
|
35 | $ S=`cat s` | |
36 | $ M=`cat m` |
|
36 | $ M=`cat m` | |
37 | $ L=`cat l` |
|
37 | $ L=`cat l` | |
38 |
|
38 | |||
39 | alignment of option descriptions in help |
|
39 | alignment of option descriptions in help | |
40 |
|
40 | |||
41 | $ cat <<EOF > .hg/hgrc |
|
41 | $ cat <<EOF > .hg/hgrc | |
42 | > [extensions] |
|
42 | > [extensions] | |
43 | > ja_ext = `pwd`/showoptlist.py |
|
43 | > ja_ext = `pwd`/showoptlist.py | |
44 | > EOF |
|
44 | > EOF | |
45 |
|
45 | |||
46 | check alignment of option descriptions in help |
|
46 | check alignment of option descriptions in help | |
47 |
|
47 | |||
48 | $ hg help showoptlist |
|
48 | $ hg help showoptlist | |
49 | hg showoptlist |
|
49 | hg showoptlist | |
50 |
|
50 | |||
51 | dummy command to show option descriptions |
|
51 | dummy command to show option descriptions | |
52 |
|
52 | |||
53 | options: |
|
53 | options: | |
54 |
|
54 | |||
55 | -s --opt1 \xe7\x9f\xad\xe5\x90\x8d short width \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d (esc) |
|
55 | -s --opt1 \xe7\x9f\xad\xe5\x90\x8d short width \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d (esc) | |
56 | -m --opt2 MIDDLE_ middle width MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ |
|
56 | -m --opt2 MIDDLE_ middle width MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ | |
57 | MIDDLE_ MIDDLE_ MIDDLE_ |
|
57 | MIDDLE_ MIDDLE_ MIDDLE_ | |
58 | -l --opt3 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d long width \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) |
|
58 | -l --opt3 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d long width \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) | |
59 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) |
|
59 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) | |
60 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) |
|
60 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) | |
61 |
|
61 | |||
62 | use "hg -v help showoptlist" to show the global options |
|
62 | use "hg -v help showoptlist" to show the global options | |
63 |
|
63 | |||
64 |
|
64 | |||
65 | $ rm -f s; touch s |
|
65 | $ rm -f s; touch s | |
66 | $ rm -f m; touch m |
|
66 | $ rm -f m; touch m | |
67 | $ rm -f l; touch l |
|
67 | $ rm -f l; touch l | |
68 |
|
68 | |||
69 | add files |
|
69 | add files | |
70 |
|
70 | |||
71 | $ cp s $S |
|
71 | $ cp s $S | |
72 | $ hg add $S |
|
72 | $ hg add $S | |
73 | $ cp m $M |
|
73 | $ cp m $M | |
74 | $ hg add $M |
|
74 | $ hg add $M | |
75 | $ cp l $L |
|
75 | $ cp l $L | |
76 | $ hg add $L |
|
76 | $ hg add $L | |
77 |
|
77 | |||
78 | commit(1) |
|
78 | commit(1) | |
79 |
|
79 | |||
80 | $ echo 'first line(1)' >> s; cp s $S |
|
80 | $ echo 'first line(1)' >> s; cp s $S | |
81 | $ echo 'first line(2)' >> m; cp m $M |
|
81 | $ echo 'first line(2)' >> m; cp m $M | |
82 | $ echo 'first line(3)' >> l; cp l $L |
|
82 | $ echo 'first line(3)' >> l; cp l $L | |
83 | $ hg commit -m 'first commit' -u $S |
|
83 | $ hg commit -m 'first commit' -u $S | |
84 |
|
84 | |||
85 | commit(2) |
|
85 | commit(2) | |
86 |
|
86 | |||
87 | $ echo 'second line(1)' >> s; cp s $S |
|
87 | $ echo 'second line(1)' >> s; cp s $S | |
88 | $ echo 'second line(2)' >> m; cp m $M |
|
88 | $ echo 'second line(2)' >> m; cp m $M | |
89 | $ echo 'second line(3)' >> l; cp l $L |
|
89 | $ echo 'second line(3)' >> l; cp l $L | |
90 | $ hg commit -m 'second commit' -u $M |
|
90 | $ hg commit -m 'second commit' -u $M | |
91 |
|
91 | |||
92 | commit(3) |
|
92 | commit(3) | |
93 |
|
93 | |||
94 | $ echo 'third line(1)' >> s; cp s $S |
|
94 | $ echo 'third line(1)' >> s; cp s $S | |
95 | $ echo 'third line(2)' >> m; cp m $M |
|
95 | $ echo 'third line(2)' >> m; cp m $M | |
96 | $ echo 'third line(3)' >> l; cp l $L |
|
96 | $ echo 'third line(3)' >> l; cp l $L | |
97 | $ hg commit -m 'third commit' -u $L |
|
97 | $ hg commit -m 'third commit' -u $L | |
98 |
|
98 | |||
99 | check alignment of user names in annotate |
|
99 | check alignment of user names in annotate | |
100 |
|
100 | |||
101 | $ hg annotate -u $M |
|
101 | $ hg annotate -u $M | |
102 | \xe7\x9f\xad\xe5\x90\x8d: first line(2) (esc) |
|
102 | \xe7\x9f\xad\xe5\x90\x8d: first line(2) (esc) | |
103 | MIDDLE_: second line(2) |
|
103 | MIDDLE_: second line(2) | |
104 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d: third line(2) (esc) |
|
104 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d: third line(2) (esc) | |
105 |
|
105 | |||
106 | check alignment of filenames in diffstat |
|
106 | check alignment of filenames in diffstat | |
107 |
|
107 | |||
108 | $ hg diff -c tip --stat |
|
108 | $ hg diff -c tip --stat | |
109 | MIDDLE_ | 1 + |
|
109 | MIDDLE_ | 1 + | |
110 | \xe7\x9f\xad\xe5\x90\x8d | 1 + (esc) |
|
110 | \xe7\x9f\xad\xe5\x90\x8d | 1 + (esc) | |
111 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d | 1 + (esc) |
|
111 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d | 1 + (esc) | |
112 | 3 files changed, 3 insertions(+), 0 deletions(-) |
|
112 | 3 files changed, 3 insertions(+), 0 deletions(-) | |
113 |
|
113 | |||
114 | add branches/tags |
|
114 | add branches/tags | |
115 |
|
115 | |||
116 | $ hg branch $S |
|
116 | $ hg branch $S | |
117 | marked working directory as branch \xe7\x9f\xad\xe5\x90\x8d (esc) |
|
117 | marked working directory as branch \xe7\x9f\xad\xe5\x90\x8d (esc) | |
118 | (branches are permanent and global, did you want a bookmark?) |
|
118 | (branches are permanent and global, did you want a bookmark?) | |
119 | $ hg tag $S |
|
119 | $ hg tag $S | |
120 | $ hg branch $M |
|
120 | $ hg branch $M | |
121 | marked working directory as branch MIDDLE_ |
|
121 | marked working directory as branch MIDDLE_ | |
122 | (branches are permanent and global, did you want a bookmark?) |
|
122 | (branches are permanent and global, did you want a bookmark?) | |
123 | $ hg tag $M |
|
123 | $ hg tag $M | |
124 | $ hg branch $L |
|
124 | $ hg branch $L | |
125 | marked working directory as branch \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) |
|
125 | marked working directory as branch \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) | |
126 | (branches are permanent and global, did you want a bookmark?) |
|
126 | (branches are permanent and global, did you want a bookmark?) | |
127 | $ hg tag $L |
|
127 | $ hg tag $L | |
128 |
|
128 | |||
129 | check alignment of branches |
|
129 | check alignment of branches | |
130 |
|
130 | |||
131 |
$ hg |
|
131 | $ hg branches | |
132 | tip 5:d745ff46155b |
|
132 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 5:d745ff46155b (esc) | |
133 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 4:9259be597f19 (esc) |
|
133 | MIDDLE_ 4:9259be597f19 (inactive) | |
134 |
|
|
134 | \xe7\x9f\xad\xe5\x90\x8d 3:b06c5b6def9e (inactive) (esc) | |
135 |
|
|
135 | default 2:64a70663cee8 (inactive) | |
136 |
|
136 | |||
137 | check alignment of tags |
|
137 | check alignment of tags | |
138 |
|
138 | |||
139 | $ hg tags |
|
139 | $ hg tags | |
140 | tip 5:d745ff46155b |
|
140 | tip 5:d745ff46155b | |
141 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 4:9259be597f19 (esc) |
|
141 | \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 4:9259be597f19 (esc) | |
142 | MIDDLE_ 3:b06c5b6def9e |
|
142 | MIDDLE_ 3:b06c5b6def9e | |
143 | \xe7\x9f\xad\xe5\x90\x8d 2:64a70663cee8 (esc) |
|
143 | \xe7\x9f\xad\xe5\x90\x8d 2:64a70663cee8 (esc) | |
144 |
|
144 | |||
145 | $ cd .. |
|
145 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now