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