##// END OF EJS Templates
tests: declare commands using decorator
Gregory Szorc -
r21254:51e5c793 default
parent child Browse files
Show More
@@ -1,46 +1,44 b''
1 1 # Extension dedicated to test patch.diff() upgrade modes
2 2 #
3 3 #
4 from mercurial import scmutil, patch, util
4 from mercurial import cmdutil, scmutil, patch, util
5 5
6 cmdtable = {}
7 command = cmdutil.command(cmdtable)
8
9 @command('autodiff',
10 [('', 'git', '', 'git upgrade mode (yes/no/auto/warn/abort)')],
11 '[OPTION]... [FILE]...')
6 12 def autodiff(ui, repo, *pats, **opts):
7 13 diffopts = patch.diffopts(ui, opts)
8 14 git = opts.get('git', 'no')
9 15 brokenfiles = set()
10 16 losedatafn = None
11 17 if git in ('yes', 'no'):
12 18 diffopts.git = git == 'yes'
13 19 diffopts.upgrade = False
14 20 elif git == 'auto':
15 21 diffopts.git = False
16 22 diffopts.upgrade = True
17 23 elif git == 'warn':
18 24 diffopts.git = False
19 25 diffopts.upgrade = True
20 26 def losedatafn(fn=None, **kwargs):
21 27 brokenfiles.add(fn)
22 28 return True
23 29 elif git == 'abort':
24 30 diffopts.git = False
25 31 diffopts.upgrade = True
26 32 def losedatafn(fn=None, **kwargs):
27 33 raise util.Abort('losing data for %s' % fn)
28 34 else:
29 35 raise util.Abort('--git must be yes, no or auto')
30 36
31 37 node1, node2 = scmutil.revpair(repo, [])
32 38 m = scmutil.match(repo[node2], pats, opts)
33 39 it = patch.diff(repo, node1, node2, match=m, opts=diffopts,
34 40 losedatafn=losedatafn)
35 41 for chunk in it:
36 42 ui.write(chunk)
37 43 for fn in sorted(brokenfiles):
38 44 ui.write(('data lost for: %s\n' % fn))
39
40 cmdtable = {
41 "autodiff":
42 (autodiff,
43 [('', 'git', '', 'git upgrade mode (yes/no/auto/warn/abort)'),
44 ],
45 '[OPTION]... [FILE]...'),
46 }
@@ -1,145 +1,144 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 > from mercurial import cmdutil
20 > cmdtable = {}
21 > command = cmdutil.command(cmdtable)
22 >
23 > @command('showoptlist',
24 > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'),
25 > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'),
26 > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s')],
27 > '')
19 28 > def showoptlist(ui, repo, *pats, **opts):
20 29 > '''dummy command to show option descriptions'''
21 30 > return 0
22 > cmdtable = {
23 > 'showoptlist':
24 > (showoptlist,
25 > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'),
26 > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'),
27 > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s')
28 > ],
29 > ""
30 > )
31 > }
32 31 > """ % globals())
33 32 > f.close()
34 33 > EOF
35 34 $ S=`cat s`
36 35 $ M=`cat m`
37 36 $ L=`cat l`
38 37
39 38 alignment of option descriptions in help
40 39
41 40 $ cat <<EOF > .hg/hgrc
42 41 > [extensions]
43 42 > ja_ext = `pwd`/showoptlist.py
44 43 > EOF
45 44
46 45 check alignment of option descriptions in help
47 46
48 47 $ hg help showoptlist
49 48 hg showoptlist
50 49
51 50 dummy command to show option descriptions
52 51
53 52 options:
54 53
55 54 -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 55 -m --opt2 MIDDLE_ middle width MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_
57 56 MIDDLE_ MIDDLE_ MIDDLE_
58 57 -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 58 \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 59 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc)
61 60
62 61 use "hg -v help showoptlist" to show the global options
63 62
64 63
65 64 $ rm -f s; touch s
66 65 $ rm -f m; touch m
67 66 $ rm -f l; touch l
68 67
69 68 add files
70 69
71 70 $ cp s $S
72 71 $ hg add $S
73 72 $ cp m $M
74 73 $ hg add $M
75 74 $ cp l $L
76 75 $ hg add $L
77 76
78 77 commit(1)
79 78
80 79 $ echo 'first line(1)' >> s; cp s $S
81 80 $ echo 'first line(2)' >> m; cp m $M
82 81 $ echo 'first line(3)' >> l; cp l $L
83 82 $ hg commit -m 'first commit' -u $S
84 83
85 84 commit(2)
86 85
87 86 $ echo 'second line(1)' >> s; cp s $S
88 87 $ echo 'second line(2)' >> m; cp m $M
89 88 $ echo 'second line(3)' >> l; cp l $L
90 89 $ hg commit -m 'second commit' -u $M
91 90
92 91 commit(3)
93 92
94 93 $ echo 'third line(1)' >> s; cp s $S
95 94 $ echo 'third line(2)' >> m; cp m $M
96 95 $ echo 'third line(3)' >> l; cp l $L
97 96 $ hg commit -m 'third commit' -u $L
98 97
99 98 check alignment of user names in annotate
100 99
101 100 $ hg annotate -u $M
102 101 \xe7\x9f\xad\xe5\x90\x8d: first line(2) (esc)
103 102 MIDDLE_: second line(2)
104 103 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d: third line(2) (esc)
105 104
106 105 check alignment of filenames in diffstat
107 106
108 107 $ hg diff -c tip --stat
109 108 MIDDLE_ | 1 +
110 109 \xe7\x9f\xad\xe5\x90\x8d | 1 + (esc)
111 110 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d | 1 + (esc)
112 111 3 files changed, 3 insertions(+), 0 deletions(-)
113 112
114 113 add branches/tags
115 114
116 115 $ hg branch $S
117 116 marked working directory as branch \xe7\x9f\xad\xe5\x90\x8d (esc)
118 117 (branches are permanent and global, did you want a bookmark?)
119 118 $ hg tag $S
120 119 $ hg branch $M
121 120 marked working directory as branch MIDDLE_
122 121 (branches are permanent and global, did you want a bookmark?)
123 122 $ hg tag $M
124 123 $ hg branch $L
125 124 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 125 (branches are permanent and global, did you want a bookmark?)
127 126 $ hg tag $L
128 127
129 128 check alignment of branches
130 129
131 130 $ hg tags
132 131 tip 5:d745ff46155b
133 132 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 4:9259be597f19 (esc)
134 133 MIDDLE_ 3:b06c5b6def9e
135 134 \xe7\x9f\xad\xe5\x90\x8d 2:64a70663cee8 (esc)
136 135
137 136 check alignment of tags
138 137
139 138 $ hg tags
140 139 tip 5:d745ff46155b
141 140 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 4:9259be597f19 (esc)
142 141 MIDDLE_ 3:b06c5b6def9e
143 142 \xe7\x9f\xad\xe5\x90\x8d 2:64a70663cee8 (esc)
144 143
145 144 $ cd ..
@@ -1,259 +1,261 b''
1 1 Test text wrapping for multibyte characters
2 2
3 3 $ mkdir t
4 4 $ cd t
5 5
6 6 define commands to display help text
7 7
8 8 $ cat << EOF > show.py
9 > from mercurial import cmdutil
10 >
11 > cmdtable = {}
12 > command = cmdutil.command(cmdtable)
13 >
9 14 > # Japanese full-width characters:
15 > @command('show_full_ja', [], '')
10 16 > def show_full_ja(ui, **opts):
11 17 > u'''\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051 \u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051 \u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051
12 18 >
13 19 > \u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051 \u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051 \u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051 \u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051
14 20 >
15 21 > \u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051
16 22 > '''
17 23 >
18 24 > # Japanese half-width characters:
25 > @command('show_half_ja', [], '')
19 26 > def show_half_ja(ui, *opts):
20 27 > u'''\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79
21 28 >
22 29 > \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79 \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79
23 30 >
24 31 > \uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79\uff71\uff72\uff73\uff74\uff75\uff76\uff77\uff78\uff79
25 32 > '''
26 33 >
27 34 > # Japanese ambiguous-width characters:
35 > @command('show_ambig_ja', [], '')
28 36 > def show_ambig_ja(ui, **opts):
29 37 > u'''\u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb
30 38 >
31 39 > \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb
32 40 >
33 41 > \u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb\u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb\u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb\u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb\u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb\u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb\u03b1\u03b2\u03b3\u03b4\u03c5\u03b6\u03b7\u03b8\u25cb
34 42 > '''
35 43 >
36 44 > # Russian ambiguous-width characters:
45 > @command('show_ambig_ru', [], '')
37 46 > def show_ambig_ru(ui, **opts):
38 47 > u'''\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
39 48 >
40 49 > \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
41 50 >
42 51 > \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438
43 52 > '''
44 >
45 > cmdtable = {
46 > 'show_full_ja': (show_full_ja, [], ""),
47 > 'show_half_ja': (show_half_ja, [], ""),
48 > 'show_ambig_ja': (show_ambig_ja, [], ""),
49 > 'show_ambig_ru': (show_ambig_ru, [], ""),
50 > }
51 53 > EOF
52 54
53 55 "COLUMNS=60" means that there is no lines which has grater than 58 width
54 56
55 57 (1) test text wrapping for non-ambiguous-width characters
56 58
57 59 (1-1) display Japanese full-width characters in cp932
58 60
59 61 $ COLUMNS=60 hg --encoding cp932 --config extensions.show=./show.py help show_full_ja
60 62 hg show_full_ja
61 63
62 64 \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf (esc)
63 65
64 66 \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf (esc)
65 67 \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf (esc)
66 68
67 69 \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf\x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf\x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf (esc)
68 70 \x82\xa0\x82\xa2\x82\xa4\x82\xa6\x82\xa8\x82\xa9\x82\xab\x82\xad\x82\xaf (esc)
69 71
70 72 use "hg -v help show_full_ja" to show the global options
71 73
72 74 (1-2) display Japanese full-width characters in utf-8
73 75
74 76 $ COLUMNS=60 hg --encoding utf-8 --config extensions.show=./show.py help show_full_ja
75 77 hg show_full_ja
76 78
77 79 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 (esc)
78 80
79 81 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 (esc)
80 82 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 (esc)
81 83
82 84 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 (esc)
83 85 \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a\xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91 (esc)
84 86
85 87 use "hg -v help show_full_ja" to show the global options
86 88
87 89
88 90 (1-3) display Japanese half-width characters in cp932
89 91
90 92 $ COLUMNS=60 hg --encoding cp932 --config extensions.show=./show.py help show_half_ja
91 93 hg show_half_ja
92 94
93 95 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 (esc)
94 96
95 97 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 (esc)
96 98 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 (esc)
97 99
98 100 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 (esc)
99 101 \xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9 (esc)
100 102
101 103 use "hg -v help show_half_ja" to show the global options
102 104
103 105 (1-4) display Japanese half-width characters in utf-8
104 106
105 107 $ COLUMNS=60 hg --encoding utf-8 --config extensions.show=./show.py help show_half_ja
106 108 hg show_half_ja
107 109
108 110 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 (esc)
109 111
110 112 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 (esc)
111 113 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 (esc)
112 114
113 115 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 (esc)
114 116 \xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9\xef\xbd\xb1\xef\xbd\xb2\xef\xbd\xb3\xef\xbd\xb4\xef\xbd\xb5\xef\xbd\xb6\xef\xbd\xb7\xef\xbd\xb8\xef\xbd\xb9 (esc)
115 117
116 118 use "hg -v help show_half_ja" to show the global options
117 119
118 120
119 121
120 122 (2) test text wrapping for ambiguous-width characters
121 123
122 124 (2-1) treat width of ambiguous characters as narrow (default)
123 125
124 126 (2-1-1) display Japanese ambiguous-width characters in cp932
125 127
126 128 $ COLUMNS=60 hg --encoding cp932 --config extensions.show=./show.py help show_ambig_ja
127 129 hg show_ambig_ja
128 130
129 131 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
130 132
131 133 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
132 134 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
133 135
134 136 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
135 137 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
136 138
137 139 use "hg -v help show_ambig_ja" to show the global options
138 140
139 141 (2-1-2) display Japanese ambiguous-width characters in utf-8
140 142
141 143 $ COLUMNS=60 hg --encoding utf-8 --config extensions.show=./show.py help show_ambig_ja
142 144 hg show_ambig_ja
143 145
144 146 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
145 147
146 148 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
147 149 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
148 150
149 151 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
150 152 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
151 153
152 154 use "hg -v help show_ambig_ja" to show the global options
153 155
154 156 (2-1-3) display Russian ambiguous-width characters in cp1251
155 157
156 158 $ COLUMNS=60 hg --encoding cp1251 --config extensions.show=./show.py help show_ambig_ru
157 159 hg show_ambig_ru
158 160
159 161 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
160 162
161 163 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
162 164 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
163 165
164 166 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
165 167 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
166 168
167 169 use "hg -v help show_ambig_ru" to show the global options
168 170
169 171 (2-1-4) display Russian ambiguous-width characters in utf-8
170 172
171 173 $ COLUMNS=60 hg --encoding utf-8 --config extensions.show=./show.py help show_ambig_ru
172 174 hg show_ambig_ru
173 175
174 176 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
175 177
176 178 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
177 179 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
178 180
179 181 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
180 182 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
181 183
182 184 use "hg -v help show_ambig_ru" to show the global options
183 185
184 186
185 187 (2-2) treat width of ambiguous characters as wide
186 188
187 189 (2-2-1) display Japanese ambiguous-width characters in cp932
188 190
189 191 $ COLUMNS=60 HGENCODINGAMBIGUOUS=wide hg --encoding cp932 --config extensions.show=./show.py help show_ambig_ja
190 192 hg show_ambig_ja
191 193
192 194 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
193 195
194 196 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
195 197 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
196 198 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
197 199 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
198 200
199 201 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
200 202 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b\x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
201 203 \x83\xbf\x83\xc0\x83\xc1\x83\xc2\x83\xd2\x83\xc4\x83\xc5\x83\xc6\x81\x9b (esc)
202 204
203 205 use "hg -v help show_ambig_ja" to show the global options
204 206
205 207 (2-2-2) display Japanese ambiguous-width characters in utf-8
206 208
207 209 $ COLUMNS=60 HGENCODINGAMBIGUOUS=wide hg --encoding utf-8 --config extensions.show=./show.py help show_ambig_ja
208 210 hg show_ambig_ja
209 211
210 212 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
211 213
212 214 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
213 215 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
214 216 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
215 217 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
216 218
217 219 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
218 220 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b\xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
219 221 \xce\xb1\xce\xb2\xce\xb3\xce\xb4\xcf\x85\xce\xb6\xce\xb7\xce\xb8\xe2\x97\x8b (esc)
220 222
221 223 use "hg -v help show_ambig_ja" to show the global options
222 224
223 225 (2-2-3) display Russian ambiguous-width characters in cp1251
224 226
225 227 $ COLUMNS=60 HGENCODINGAMBIGUOUS=wide hg --encoding cp1251 --config extensions.show=./show.py help show_ambig_ru
226 228 hg show_ambig_ru
227 229
228 230 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
229 231 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
230 232
231 233 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
232 234 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
233 235 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
234 236
235 237 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
236 238 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8\xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
237 239 \xcd\xe0\xf1\xf2\xf0\xee\xe9\xea\xe8 (esc)
238 240
239 241 use "hg -v help show_ambig_ru" to show the global options
240 242
241 243 (2-2-4) display Russian ambiguous-width characters in utf-8
242 244
243 245 $ COLUMNS=60 HGENCODINGAMBIGUOUS=wide hg --encoding utf-8 --config extensions.show=./show.py help show_ambig_ru
244 246 hg show_ambig_ru
245 247
246 248 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
247 249 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
248 250
249 251 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
250 252 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
251 253 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
252 254
253 255 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
254 256 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8\xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
255 257 \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
256 258
257 259 use "hg -v help show_ambig_ru" to show the global options
258 260
259 261 $ cd ..
@@ -1,847 +1,850 b''
1 1 Test basic extension support
2 2
3 3 $ cat > foobar.py <<EOF
4 4 > import os
5 > from mercurial import commands
5 > from mercurial import cmdutil, commands
6 >
7 > cmdtable = {}
8 > command = cmdutil.command(cmdtable)
6 9 >
7 10 > def uisetup(ui):
8 11 > ui.write("uisetup called\\n")
9 12 >
10 13 > def reposetup(ui, repo):
11 14 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
12 15 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
13 16 >
17 > @command('foo', [], 'hg foo')
14 18 > def foo(ui, *args, **kwargs):
15 19 > ui.write("Foo\\n")
16 20 >
21 > @command('bar', [], 'hg bar')
17 22 > def bar(ui, *args, **kwargs):
18 23 > ui.write("Bar\\n")
19 24 >
20 > cmdtable = {
21 > "foo": (foo, [], "hg foo"),
22 > "bar": (bar, [], "hg bar"),
23 > }
24 >
25 25 > commands.norepo += ' bar'
26 26 > EOF
27 27 $ abspath=`pwd`/foobar.py
28 28
29 29 $ mkdir barfoo
30 30 $ cp foobar.py barfoo/__init__.py
31 31 $ barfoopath=`pwd`/barfoo
32 32
33 33 $ hg init a
34 34 $ cd a
35 35 $ echo foo > file
36 36 $ hg add file
37 37 $ hg commit -m 'add file'
38 38
39 39 $ echo '[extensions]' >> $HGRCPATH
40 40 $ echo "foobar = $abspath" >> $HGRCPATH
41 41 $ hg foo
42 42 uisetup called
43 43 reposetup called for a
44 44 ui == repo.ui
45 45 Foo
46 46
47 47 $ cd ..
48 48 $ hg clone a b
49 49 uisetup called
50 50 reposetup called for a
51 51 ui == repo.ui
52 52 reposetup called for b
53 53 ui == repo.ui
54 54 updating to branch default
55 55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 56
57 57 $ hg bar
58 58 uisetup called
59 59 Bar
60 60 $ echo 'foobar = !' >> $HGRCPATH
61 61
62 62 module/__init__.py-style
63 63
64 64 $ echo "barfoo = $barfoopath" >> $HGRCPATH
65 65 $ cd a
66 66 $ hg foo
67 67 uisetup called
68 68 reposetup called for a
69 69 ui == repo.ui
70 70 Foo
71 71 $ echo 'barfoo = !' >> $HGRCPATH
72 72
73 73 Check that extensions are loaded in phases:
74 74
75 75 $ cat > foo.py <<EOF
76 76 > import os
77 77 > name = os.path.basename(__file__).rsplit('.', 1)[0]
78 78 > print "1) %s imported" % name
79 79 > def uisetup(ui):
80 80 > print "2) %s uisetup" % name
81 81 > def extsetup():
82 82 > print "3) %s extsetup" % name
83 83 > def reposetup(ui, repo):
84 84 > print "4) %s reposetup" % name
85 85 > EOF
86 86
87 87 $ cp foo.py bar.py
88 88 $ echo 'foo = foo.py' >> $HGRCPATH
89 89 $ echo 'bar = bar.py' >> $HGRCPATH
90 90
91 91 Command with no output, we just want to see the extensions loaded:
92 92
93 93 $ hg paths
94 94 1) foo imported
95 95 1) bar imported
96 96 2) foo uisetup
97 97 2) bar uisetup
98 98 3) foo extsetup
99 99 3) bar extsetup
100 100 4) foo reposetup
101 101 4) bar reposetup
102 102
103 103 Check hgweb's load order:
104 104
105 105 $ cat > hgweb.cgi <<EOF
106 106 > #!/usr/bin/env python
107 107 > from mercurial import demandimport; demandimport.enable()
108 108 > from mercurial.hgweb import hgweb
109 109 > from mercurial.hgweb import wsgicgi
110 110 >
111 111 > application = hgweb('.', 'test repo')
112 112 > wsgicgi.launch(application)
113 113 > EOF
114 114
115 115 $ REQUEST_METHOD='GET' PATH_INFO='/' SCRIPT_NAME='' QUERY_STRING='' \
116 116 > SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
117 117 > | grep '^[0-9]) ' # ignores HTML output
118 118 1) foo imported
119 119 1) bar imported
120 120 2) foo uisetup
121 121 2) bar uisetup
122 122 3) foo extsetup
123 123 3) bar extsetup
124 124 4) foo reposetup
125 125 4) bar reposetup
126 126 4) foo reposetup
127 127 4) bar reposetup
128 128
129 129 $ echo 'foo = !' >> $HGRCPATH
130 130 $ echo 'bar = !' >> $HGRCPATH
131 131
132 132 Check "from __future__ import absolute_import" support for external libraries
133 133
134 134 #if windows
135 135 $ PATHSEP=";"
136 136 #else
137 137 $ PATHSEP=":"
138 138 #endif
139 139 $ export PATHSEP
140 140
141 141 $ mkdir $TESTTMP/libroot
142 142 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
143 143 $ mkdir $TESTTMP/libroot/mod
144 144 $ touch $TESTTMP/libroot/mod/__init__.py
145 145 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
146 146
147 147 #if absimport
148 148 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF
149 149 > from __future__ import absolute_import
150 150 > import ambig # should load "libroot/ambig.py"
151 151 > s = ambig.s
152 152 > EOF
153 153 $ cat > loadabs.py <<EOF
154 154 > import mod.ambigabs as ambigabs
155 155 > def extsetup():
156 156 > print 'ambigabs.s=%s' % ambigabs.s
157 157 > EOF
158 158 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
159 159 ambigabs.s=libroot/ambig.py
160 160 $TESTTMP/a (glob)
161 161 #endif
162 162
163 163 #if no-py3k
164 164 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
165 165 > import ambig # should load "libroot/mod/ambig.py"
166 166 > s = ambig.s
167 167 > EOF
168 168 $ cat > loadrel.py <<EOF
169 169 > import mod.ambigrel as ambigrel
170 170 > def extsetup():
171 171 > print 'ambigrel.s=%s' % ambigrel.s
172 172 > EOF
173 173 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
174 174 ambigrel.s=libroot/mod/ambig.py
175 175 $TESTTMP/a (glob)
176 176 #endif
177 177
178 178 Check absolute/relative import of extension specific modules
179 179
180 180 $ mkdir $TESTTMP/extroot
181 181 $ cat > $TESTTMP/extroot/bar.py <<EOF
182 182 > s = 'this is extroot.bar'
183 183 > EOF
184 184 $ mkdir $TESTTMP/extroot/sub1
185 185 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF
186 186 > s = 'this is extroot.sub1.__init__'
187 187 > EOF
188 188 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF
189 189 > s = 'this is extroot.sub1.baz'
190 190 > EOF
191 191 $ cat > $TESTTMP/extroot/__init__.py <<EOF
192 192 > s = 'this is extroot.__init__'
193 193 > import foo
194 194 > def extsetup(ui):
195 195 > ui.write('(extroot) ', foo.func(), '\n')
196 196 > EOF
197 197
198 198 $ cat > $TESTTMP/extroot/foo.py <<EOF
199 199 > # test absolute import
200 200 > buf = []
201 201 > def func():
202 202 > # "not locals" case
203 203 > import extroot.bar
204 204 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s)
205 205 >
206 206 > return '\n(extroot) '.join(buf)
207 207 >
208 208 > # "fromlist == ('*',)" case
209 209 > from extroot.bar import *
210 210 > buf.append('from extroot.bar import *: %s' % s)
211 211 >
212 212 > # "not fromlist" and "if '.' in name" case
213 213 > import extroot.sub1.baz
214 214 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
215 215 >
216 216 > # "not fromlist" and NOT "if '.' in name" case
217 217 > import extroot
218 218 > buf.append('import extroot: %s' % extroot.s)
219 219 >
220 220 > # NOT "not fromlist" and NOT "level != -1" case
221 221 > from extroot.bar import s
222 222 > buf.append('from extroot.bar import s: %s' % s)
223 223 > EOF
224 224 $ hg --config extensions.extroot=$TESTTMP/extroot root
225 225 (extroot) from extroot.bar import *: this is extroot.bar
226 226 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
227 227 (extroot) import extroot: this is extroot.__init__
228 228 (extroot) from extroot.bar import s: this is extroot.bar
229 229 (extroot) import extroot.bar in func(): this is extroot.bar
230 230 $TESTTMP/a (glob)
231 231
232 232 #if no-py3k
233 233 $ rm "$TESTTMP"/extroot/foo.*
234 234 $ cat > $TESTTMP/extroot/foo.py <<EOF
235 235 > # test relative import
236 236 > buf = []
237 237 > def func():
238 238 > # "not locals" case
239 239 > import bar
240 240 > buf.append('import bar in func(): %s' % bar.s)
241 241 >
242 242 > return '\n(extroot) '.join(buf)
243 243 >
244 244 > # "fromlist == ('*',)" case
245 245 > from bar import *
246 246 > buf.append('from bar import *: %s' % s)
247 247 >
248 248 > # "not fromlist" and "if '.' in name" case
249 249 > import sub1.baz
250 250 > buf.append('import sub1.baz: %s' % sub1.baz.s)
251 251 >
252 252 > # "not fromlist" and NOT "if '.' in name" case
253 253 > import sub1
254 254 > buf.append('import sub1: %s' % sub1.s)
255 255 >
256 256 > # NOT "not fromlist" and NOT "level != -1" case
257 257 > from bar import s
258 258 > buf.append('from bar import s: %s' % s)
259 259 > EOF
260 260 $ hg --config extensions.extroot=$TESTTMP/extroot root
261 261 (extroot) from bar import *: this is extroot.bar
262 262 (extroot) import sub1.baz: this is extroot.sub1.baz
263 263 (extroot) import sub1: this is extroot.sub1.__init__
264 264 (extroot) from bar import s: this is extroot.bar
265 265 (extroot) import bar in func(): this is extroot.bar
266 266 $TESTTMP/a (glob)
267 267 #endif
268 268
269 269 $ cd ..
270 270
271 271 hide outer repo
272 272 $ hg init
273 273
274 274 $ cat > empty.py <<EOF
275 275 > '''empty cmdtable
276 276 > '''
277 277 > cmdtable = {}
278 278 > EOF
279 279 $ emptypath=`pwd`/empty.py
280 280 $ echo "empty = $emptypath" >> $HGRCPATH
281 281 $ hg help empty
282 282 empty extension - empty cmdtable
283 283
284 284 no commands defined
285 285
286 286 $ echo 'empty = !' >> $HGRCPATH
287 287
288 288 $ cat > debugextension.py <<EOF
289 289 > '''only debugcommands
290 290 > '''
291 > from mercurial import cmdutil
292 > cmdtable = {}
293 > command = cmdutil.command(cmdtable)
294 >
295 > @command('debugfoobar', [], 'hg debugfoobar')
291 296 > def debugfoobar(ui, repo, *args, **opts):
292 297 > "yet another debug command"
293 298 > pass
294 299 >
300 > @command('foo', [], 'hg foo')
295 301 > def foo(ui, repo, *args, **opts):
296 302 > """yet another foo command
297 303 >
298 304 > This command has been DEPRECATED since forever.
299 305 > """
300 306 > pass
301 >
302 > cmdtable = {
303 > "debugfoobar": (debugfoobar, (), "hg debugfoobar"),
304 > "foo": (foo, (), "hg foo")
305 > }
306 307 > EOF
307 308 $ debugpath=`pwd`/debugextension.py
308 309 $ echo "debugextension = $debugpath" >> $HGRCPATH
309 310
310 311 $ hg help debugextension
311 312 debugextension extension - only debugcommands
312 313
313 314 no commands defined
314 315
315 316 $ hg --verbose help debugextension
316 317 debugextension extension - only debugcommands
317 318
318 319 list of commands:
319 320
320 321 foo yet another foo command
321 322
322 323 global options:
323 324
324 325 -R --repository REPO repository root directory or name of overlay bundle
325 326 file
326 327 --cwd DIR change working directory
327 328 -y --noninteractive do not prompt, automatically pick the first choice for
328 329 all prompts
329 330 -q --quiet suppress output
330 331 -v --verbose enable additional output
331 332 --config CONFIG [+] set/override config option (use 'section.name=value')
332 333 --debug enable debugging output
333 334 --debugger start debugger
334 335 --encoding ENCODE set the charset encoding (default: ascii)
335 336 --encodingmode MODE set the charset encoding mode (default: strict)
336 337 --traceback always print a traceback on exception
337 338 --time time how long the command takes
338 339 --profile print command execution profile
339 340 --version output version information and exit
340 341 -h --help display help and exit
341 342 --hidden consider hidden changesets
342 343
343 344 [+] marked option can be specified multiple times
344 345
345 346 $ hg --debug help debugextension
346 347 debugextension extension - only debugcommands
347 348
348 349 list of commands:
349 350
350 351 debugfoobar yet another debug command
351 352 foo yet another foo command
352 353
353 354 global options:
354 355
355 356 -R --repository REPO repository root directory or name of overlay bundle
356 357 file
357 358 --cwd DIR change working directory
358 359 -y --noninteractive do not prompt, automatically pick the first choice for
359 360 all prompts
360 361 -q --quiet suppress output
361 362 -v --verbose enable additional output
362 363 --config CONFIG [+] set/override config option (use 'section.name=value')
363 364 --debug enable debugging output
364 365 --debugger start debugger
365 366 --encoding ENCODE set the charset encoding (default: ascii)
366 367 --encodingmode MODE set the charset encoding mode (default: strict)
367 368 --traceback always print a traceback on exception
368 369 --time time how long the command takes
369 370 --profile print command execution profile
370 371 --version output version information and exit
371 372 -h --help display help and exit
372 373 --hidden consider hidden changesets
373 374
374 375 [+] marked option can be specified multiple times
375 376 $ echo 'debugextension = !' >> $HGRCPATH
376 377
377 378 Extension module help vs command help:
378 379
379 380 $ echo 'extdiff =' >> $HGRCPATH
380 381 $ hg help extdiff
381 382 hg extdiff [OPT]... [FILE]...
382 383
383 384 use external program to diff repository (or selected files)
384 385
385 386 Show differences between revisions for the specified files, using an
386 387 external program. The default program used is diff, with default options
387 388 "-Npru".
388 389
389 390 To select a different program, use the -p/--program option. The program
390 391 will be passed the names of two directories to compare. To pass additional
391 392 options to the program, use -o/--option. These will be passed before the
392 393 names of the directories to compare.
393 394
394 395 When two revision arguments are given, then changes are shown between
395 396 those revisions. If only one revision is specified then that revision is
396 397 compared to the working directory, and, when no revisions are specified,
397 398 the working directory files are compared to its parent.
398 399
399 400 use "hg help -e extdiff" to show help for the extdiff extension
400 401
401 402 options:
402 403
403 404 -p --program CMD comparison program to run
404 405 -o --option OPT [+] pass option to comparison program
405 406 -r --rev REV [+] revision
406 407 -c --change REV change made by revision
407 408 -I --include PATTERN [+] include names matching the given patterns
408 409 -X --exclude PATTERN [+] exclude names matching the given patterns
409 410
410 411 [+] marked option can be specified multiple times
411 412
412 413 use "hg -v help extdiff" to show the global options
413 414
414 415 $ hg help --extension extdiff
415 416 extdiff extension - command to allow external programs to compare revisions
416 417
417 418 The extdiff Mercurial extension allows you to use external programs to compare
418 419 revisions, or revision with working directory. The external diff programs are
419 420 called with a configurable set of options and two non-option arguments: paths
420 421 to directories containing snapshots of files to compare.
421 422
422 423 The extdiff extension also allows you to configure new diff commands, so you
423 424 do not need to type "hg extdiff -p kdiff3" always.
424 425
425 426 [extdiff]
426 427 # add new command that runs GNU diff(1) in 'context diff' mode
427 428 cdiff = gdiff -Nprc5
428 429 ## or the old way:
429 430 #cmd.cdiff = gdiff
430 431 #opts.cdiff = -Nprc5
431 432
432 433 # add new command called vdiff, runs kdiff3
433 434 vdiff = kdiff3
434 435
435 436 # add new command called meld, runs meld (no need to name twice)
436 437 meld =
437 438
438 439 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
439 440 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
440 441 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
441 442 # your .vimrc
442 443 vimdiff = gvim -f "+next" \
443 444 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
444 445
445 446 Tool arguments can include variables that are expanded at runtime:
446 447
447 448 $parent1, $plabel1 - filename, descriptive label of first parent
448 449 $child, $clabel - filename, descriptive label of child revision
449 450 $parent2, $plabel2 - filename, descriptive label of second parent
450 451 $root - repository root
451 452 $parent is an alias for $parent1.
452 453
453 454 The extdiff extension will look in your [diff-tools] and [merge-tools]
454 455 sections for diff tool arguments, when none are specified in [extdiff].
455 456
456 457 [extdiff]
457 458 kdiff3 =
458 459
459 460 [diff-tools]
460 461 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
461 462
462 463 You can use -I/-X and list of file or directory names like normal "hg diff"
463 464 command. The extdiff extension makes snapshots of only needed files, so
464 465 running the external diff program will actually be pretty fast (at least
465 466 faster than having to compare the entire tree).
466 467
467 468 list of commands:
468 469
469 470 extdiff use external program to diff repository (or selected files)
470 471
471 472 use "hg -v help extdiff" to show builtin aliases and global options
472 473
473 474 $ echo 'extdiff = !' >> $HGRCPATH
474 475
475 476 Test help topic with same name as extension
476 477
477 478 $ cat > multirevs.py <<EOF
478 > from mercurial import commands
479 > from mercurial import cmdutil, commands
480 > cmdtable = {}
481 > command = cmdutil.command(cmdtable)
479 482 > """multirevs extension
480 483 > Big multi-line module docstring."""
484 > @command('multirevs', [], 'ARG')
481 485 > def multirevs(ui, repo, arg, *args, **opts):
482 486 > """multirevs command"""
483 487 > pass
484 > cmdtable = {
485 > "multirevs": (multirevs, [], 'ARG')
486 > }
487 488 > commands.norepo += ' multirevs'
488 489 > EOF
489 490 $ echo "multirevs = multirevs.py" >> $HGRCPATH
490 491
491 492 $ hg help multirevs
492 493 Specifying Multiple Revisions
493 494 """""""""""""""""""""""""""""
494 495
495 496 When Mercurial accepts more than one revision, they may be specified
496 497 individually, or provided as a topologically continuous range, separated
497 498 by the ":" character.
498 499
499 500 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
500 501 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
501 502 specified, it defaults to revision number 0. If END is not specified, it
502 503 defaults to the tip. The range ":" thus means "all revisions".
503 504
504 505 If BEGIN is greater than END, revisions are treated in reverse order.
505 506
506 507 A range acts as a closed interval. This means that a range of 3:5 gives 3,
507 508 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
508 509
509 510 use "hg help -c multirevs" to see help for the multirevs command
510 511
511 512 $ hg help -c multirevs
512 513 hg multirevs ARG
513 514
514 515 multirevs command
515 516
516 517 use "hg -v help multirevs" to show the global options
517 518
518 519 $ hg multirevs
519 520 hg multirevs: invalid arguments
520 521 hg multirevs ARG
521 522
522 523 multirevs command
523 524
524 525 use "hg help multirevs" to show the full help text
525 526 [255]
526 527
527 528 $ echo "multirevs = !" >> $HGRCPATH
528 529
529 530 Issue811: Problem loading extensions twice (by site and by user)
530 531
531 532 $ debugpath=`pwd`/debugissue811.py
532 533 $ cat > debugissue811.py <<EOF
533 534 > '''show all loaded extensions
534 535 > '''
535 > from mercurial import extensions, commands
536 > from mercurial import cmdutil, commands, extensions
537 > cmdtable = {}
538 > command = cmdutil.command(cmdtable)
536 539 >
540 > @command('debugextensions', [], 'hg debugextensions')
537 541 > def debugextensions(ui):
538 542 > "yet another debug command"
539 543 > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
540 544 >
541 > cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")}
542 545 > commands.norepo += " debugextensions"
543 546 > EOF
544 547 $ echo "debugissue811 = $debugpath" >> $HGRCPATH
545 548 $ echo "mq=" >> $HGRCPATH
546 549 $ echo "strip=" >> $HGRCPATH
547 550 $ echo "hgext.mq=" >> $HGRCPATH
548 551 $ echo "hgext/mq=" >> $HGRCPATH
549 552
550 553 Show extensions:
551 554 (note that mq force load strip, also checking it's not loaded twice)
552 555
553 556 $ hg debugextensions
554 557 debugissue811
555 558 strip
556 559 mq
557 560
558 561 Disabled extension commands:
559 562
560 563 $ ORGHGRCPATH=$HGRCPATH
561 564 $ HGRCPATH=
562 565 $ export HGRCPATH
563 566 $ hg help email
564 567 'email' is provided by the following extension:
565 568
566 569 patchbomb command to send changesets as (a series of) patch emails
567 570
568 571 use "hg help extensions" for information on enabling extensions
569 572 $ hg qdel
570 573 hg: unknown command 'qdel'
571 574 'qdelete' is provided by the following extension:
572 575
573 576 mq manage a stack of patches
574 577
575 578 use "hg help extensions" for information on enabling extensions
576 579 [255]
577 580 $ hg churn
578 581 hg: unknown command 'churn'
579 582 'churn' is provided by the following extension:
580 583
581 584 churn command to display statistics about repository history
582 585
583 586 use "hg help extensions" for information on enabling extensions
584 587 [255]
585 588
586 589 Disabled extensions:
587 590
588 591 $ hg help churn
589 592 churn extension - command to display statistics about repository history
590 593
591 594 use "hg help extensions" for information on enabling extensions
592 595 $ hg help patchbomb
593 596 patchbomb extension - command to send changesets as (a series of) patch emails
594 597
595 598 use "hg help extensions" for information on enabling extensions
596 599
597 600 Broken disabled extension and command:
598 601
599 602 $ mkdir hgext
600 603 $ echo > hgext/__init__.py
601 604 $ cat > hgext/broken.py <<EOF
602 605 > "broken extension'
603 606 > EOF
604 607 $ cat > path.py <<EOF
605 608 > import os, sys
606 609 > sys.path.insert(0, os.environ['HGEXTPATH'])
607 610 > EOF
608 611 $ HGEXTPATH=`pwd`
609 612 $ export HGEXTPATH
610 613
611 614 $ hg --config extensions.path=./path.py help broken
612 615 broken extension - (no help text available)
613 616
614 617 use "hg help extensions" for information on enabling extensions
615 618
616 619 $ cat > hgext/forest.py <<EOF
617 620 > cmdtable = None
618 621 > EOF
619 622 $ hg --config extensions.path=./path.py help foo > /dev/null
620 623 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
621 624 hg: unknown command 'foo'
622 625 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
623 626 [255]
624 627
625 628 $ cat > throw.py <<EOF
626 629 > from mercurial import cmdutil, commands
627 630 > cmdtable = {}
628 631 > command = cmdutil.command(cmdtable)
629 632 > class Bogon(Exception): pass
630 633 >
631 634 > @command('throw', [], 'hg throw')
632 635 > def throw(ui, **opts):
633 636 > """throws an exception"""
634 637 > raise Bogon()
635 638 > commands.norepo += " throw"
636 639 > EOF
637 640 No declared supported version, extension complains:
638 641 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
639 642 ** Unknown exception encountered with possibly-broken third-party extension throw
640 643 ** which supports versions unknown of Mercurial.
641 644 ** Please disable throw and try your action again.
642 645 ** If that fixes the bug please report it to the extension author.
643 646 ** Python * (glob)
644 647 ** Mercurial Distributed SCM * (glob)
645 648 ** Extensions loaded: throw
646 649 empty declaration of supported version, extension complains:
647 650 $ echo "testedwith = ''" >> throw.py
648 651 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
649 652 ** Unknown exception encountered with possibly-broken third-party extension throw
650 653 ** which supports versions unknown of Mercurial.
651 654 ** Please disable throw and try your action again.
652 655 ** If that fixes the bug please report it to the extension author.
653 656 ** Python * (glob)
654 657 ** Mercurial Distributed SCM (*) (glob)
655 658 ** Extensions loaded: throw
656 659 If the extension specifies a buglink, show that:
657 660 $ echo 'buglink = "http://example.com/bts"' >> throw.py
658 661 $ rm -f throw.pyc throw.pyo
659 662 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
660 663 ** Unknown exception encountered with possibly-broken third-party extension throw
661 664 ** which supports versions unknown of Mercurial.
662 665 ** Please disable throw and try your action again.
663 666 ** If that fixes the bug please report it to http://example.com/bts
664 667 ** Python * (glob)
665 668 ** Mercurial Distributed SCM (*) (glob)
666 669 ** Extensions loaded: throw
667 670 If the extensions declare outdated versions, accuse the older extension first:
668 671 $ echo "from mercurial import util" >> older.py
669 672 $ echo "util.version = lambda:'2.2'" >> older.py
670 673 $ echo "testedwith = '1.9.3'" >> older.py
671 674 $ echo "testedwith = '2.1.1'" >> throw.py
672 675 $ rm -f throw.pyc throw.pyo
673 676 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
674 677 > throw 2>&1 | egrep '^\*\*'
675 678 ** Unknown exception encountered with possibly-broken third-party extension older
676 679 ** which supports versions 1.9.3 of Mercurial.
677 680 ** Please disable older and try your action again.
678 681 ** If that fixes the bug please report it to the extension author.
679 682 ** Python * (glob)
680 683 ** Mercurial Distributed SCM (version 2.2)
681 684 ** Extensions loaded: throw, older
682 685 One extension only tested with older, one only with newer versions:
683 686 $ echo "util.version = lambda:'2.1.0'" >> older.py
684 687 $ rm -f older.pyc older.pyo
685 688 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
686 689 > throw 2>&1 | egrep '^\*\*'
687 690 ** Unknown exception encountered with possibly-broken third-party extension older
688 691 ** which supports versions 1.9.3 of Mercurial.
689 692 ** Please disable older and try your action again.
690 693 ** If that fixes the bug please report it to the extension author.
691 694 ** Python * (glob)
692 695 ** Mercurial Distributed SCM (version 2.1.0)
693 696 ** Extensions loaded: throw, older
694 697 Older extension is tested with current version, the other only with newer:
695 698 $ echo "util.version = lambda:'1.9.3'" >> older.py
696 699 $ rm -f older.pyc older.pyo
697 700 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
698 701 > throw 2>&1 | egrep '^\*\*'
699 702 ** Unknown exception encountered with possibly-broken third-party extension throw
700 703 ** which supports versions 2.1.1 of Mercurial.
701 704 ** Please disable throw and try your action again.
702 705 ** If that fixes the bug please report it to http://example.com/bts
703 706 ** Python * (glob)
704 707 ** Mercurial Distributed SCM (version 1.9.3)
705 708 ** Extensions loaded: throw, older
706 709
707 710 Declare the version as supporting this hg version, show regular bts link:
708 711 $ hgver=`python -c 'from mercurial import util; print util.version().split("+")[0]'`
709 712 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
710 713 $ rm -f throw.pyc throw.pyo
711 714 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
712 715 ** unknown exception encountered, please report by visiting
713 716 ** http://mercurial.selenic.com/wiki/BugTracker
714 717 ** Python * (glob)
715 718 ** Mercurial Distributed SCM (*) (glob)
716 719 ** Extensions loaded: throw
717 720
718 721 Restore HGRCPATH
719 722
720 723 $ HGRCPATH=$ORGHGRCPATH
721 724 $ export HGRCPATH
722 725
723 726 Commands handling multiple repositories at a time should invoke only
724 727 "reposetup()" of extensions enabling in the target repository.
725 728
726 729 $ mkdir reposetup-test
727 730 $ cd reposetup-test
728 731
729 732 $ cat > $TESTTMP/reposetuptest.py <<EOF
730 733 > from mercurial import extensions
731 734 > def reposetup(ui, repo):
732 735 > ui.write('reposetup() for %s\n' % (repo.root))
733 736 > EOF
734 737 $ hg init src
735 738 $ echo a > src/a
736 739 $ hg -R src commit -Am '#0 at src/a'
737 740 adding a
738 741 $ echo '[extensions]' >> src/.hg/hgrc
739 742 $ echo '# enable extension locally' >> src/.hg/hgrc
740 743 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
741 744 $ hg -R src status
742 745 reposetup() for $TESTTMP/reposetup-test/src (glob)
743 746
744 747 $ hg clone -U src clone-dst1
745 748 reposetup() for $TESTTMP/reposetup-test/src (glob)
746 749 $ hg init push-dst1
747 750 $ hg -q -R src push push-dst1
748 751 reposetup() for $TESTTMP/reposetup-test/src (glob)
749 752 $ hg init pull-src1
750 753 $ hg -q -R pull-src1 pull src
751 754 reposetup() for $TESTTMP/reposetup-test/src (glob)
752 755
753 756 $ echo '[extensions]' >> $HGRCPATH
754 757 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
755 758 $ echo 'reposetuptest = !' >> $HGRCPATH
756 759 $ hg clone -U src clone-dst2
757 760 reposetup() for $TESTTMP/reposetup-test/src (glob)
758 761 $ hg init push-dst2
759 762 $ hg -q -R src push push-dst2
760 763 reposetup() for $TESTTMP/reposetup-test/src (glob)
761 764 $ hg init pull-src2
762 765 $ hg -q -R pull-src2 pull src
763 766 reposetup() for $TESTTMP/reposetup-test/src (glob)
764 767
765 768 $ echo '[extensions]' >> $HGRCPATH
766 769 $ echo '# enable extension globally' >> $HGRCPATH
767 770 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH
768 771 $ hg clone -U src clone-dst3
769 772 reposetup() for $TESTTMP/reposetup-test/src (glob)
770 773 reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
771 774 $ hg init push-dst3
772 775 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
773 776 $ hg -q -R src push push-dst3
774 777 reposetup() for $TESTTMP/reposetup-test/src (glob)
775 778 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
776 779 $ hg init pull-src3
777 780 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
778 781 $ hg -q -R pull-src3 pull src
779 782 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
780 783 reposetup() for $TESTTMP/reposetup-test/src (glob)
781 784
782 785 $ echo '[extensions]' >> src/.hg/hgrc
783 786 $ echo '# disable extension locally' >> src/.hg/hgrc
784 787 $ echo 'reposetuptest = !' >> src/.hg/hgrc
785 788 $ hg clone -U src clone-dst4
786 789 reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob)
787 790 $ hg init push-dst4
788 791 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
789 792 $ hg -q -R src push push-dst4
790 793 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
791 794 $ hg init pull-src4
792 795 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
793 796 $ hg -q -R pull-src4 pull src
794 797 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
795 798
796 799 disabling in command line overlays with all configuration
797 800 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
798 801 $ hg --config extensions.reposetuptest=! init push-dst5
799 802 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
800 803 $ hg --config extensions.reposetuptest=! init pull-src5
801 804 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
802 805
803 806 $ echo '[extensions]' >> $HGRCPATH
804 807 $ echo '# disable extension globally and explicitly' >> $HGRCPATH
805 808 $ echo 'reposetuptest = !' >> $HGRCPATH
806 809 $ hg init parent
807 810 $ hg init parent/sub1
808 811 $ echo 1 > parent/sub1/1
809 812 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
810 813 adding 1
811 814 $ hg init parent/sub2
812 815 $ hg init parent/sub2/sub21
813 816 $ echo 21 > parent/sub2/sub21/21
814 817 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
815 818 adding 21
816 819 $ cat > parent/sub2/.hgsub <<EOF
817 820 > sub21 = sub21
818 821 > EOF
819 822 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
820 823 adding .hgsub
821 824 $ hg init parent/sub3
822 825 $ echo 3 > parent/sub3/3
823 826 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
824 827 adding 3
825 828 $ cat > parent/.hgsub <<EOF
826 829 > sub1 = sub1
827 830 > sub2 = sub2
828 831 > sub3 = sub3
829 832 > EOF
830 833 $ hg -R parent commit -Am '#0 at parent'
831 834 adding .hgsub
832 835 $ echo '[extensions]' >> parent/.hg/hgrc
833 836 $ echo '# enable extension locally' >> parent/.hg/hgrc
834 837 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
835 838 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
836 839 $ hg -R parent status -S -A
837 840 reposetup() for $TESTTMP/reposetup-test/parent (glob)
838 841 reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob)
839 842 C .hgsub
840 843 C .hgsubstate
841 844 C sub1/1
842 845 C sub2/.hgsub
843 846 C sub2/.hgsubstate
844 847 C sub2/sub21/21
845 848 C sub3/3
846 849
847 850 $ cd ..
@@ -1,2094 +1,2095 b''
1 1 Short help:
2 2
3 3 $ hg
4 4 Mercurial Distributed SCM
5 5
6 6 basic commands:
7 7
8 8 add add the specified files on the next commit
9 9 annotate show changeset information by line for each file
10 10 clone make a copy of an existing repository
11 11 commit commit the specified files or all outstanding changes
12 12 diff diff repository (or selected files)
13 13 export dump the header and diffs for one or more changesets
14 14 forget forget the specified files on the next commit
15 15 init create a new repository in the given directory
16 16 log show revision history of entire repository or files
17 17 merge merge working directory with another revision
18 18 pull pull changes from the specified source
19 19 push push changes to the specified destination
20 20 remove remove the specified files on the next commit
21 21 serve start stand-alone webserver
22 22 status show changed files in the working directory
23 23 summary summarize working directory state
24 24 update update working directory (or switch revisions)
25 25
26 26 use "hg help" for the full list of commands or "hg -v" for details
27 27
28 28 $ hg -q
29 29 add add the specified files on the next commit
30 30 annotate show changeset information by line for each file
31 31 clone make a copy of an existing repository
32 32 commit commit the specified files or all outstanding changes
33 33 diff diff repository (or selected files)
34 34 export dump the header and diffs for one or more changesets
35 35 forget forget the specified files on the next commit
36 36 init create a new repository in the given directory
37 37 log show revision history of entire repository or files
38 38 merge merge working directory with another revision
39 39 pull pull changes from the specified source
40 40 push push changes to the specified destination
41 41 remove remove the specified files on the next commit
42 42 serve start stand-alone webserver
43 43 status show changed files in the working directory
44 44 summary summarize working directory state
45 45 update update working directory (or switch revisions)
46 46
47 47 $ hg help
48 48 Mercurial Distributed SCM
49 49
50 50 list of commands:
51 51
52 52 add add the specified files on the next commit
53 53 addremove add all new files, delete all missing files
54 54 annotate show changeset information by line for each file
55 55 archive create an unversioned archive of a repository revision
56 56 backout reverse effect of earlier changeset
57 57 bisect subdivision search of changesets
58 58 bookmarks track a line of development with movable markers
59 59 branch set or show the current branch name
60 60 branches list repository named branches
61 61 bundle create a changegroup file
62 62 cat output the current or given revision of files
63 63 clone make a copy of an existing repository
64 64 commit commit the specified files or all outstanding changes
65 65 config show combined config settings from all hgrc files
66 66 copy mark files as copied for the next commit
67 67 diff diff repository (or selected files)
68 68 export dump the header and diffs for one or more changesets
69 69 forget forget the specified files on the next commit
70 70 graft copy changes from other branches onto the current branch
71 71 grep search for a pattern in specified files and revisions
72 72 heads show branch heads
73 73 help show help for a given topic or a help overview
74 74 identify identify the working copy or specified revision
75 75 import import an ordered set of patches
76 76 incoming show new changesets found in source
77 77 init create a new repository in the given directory
78 78 locate locate files matching specific patterns
79 79 log show revision history of entire repository or files
80 80 manifest output the current or given revision of the project manifest
81 81 merge merge working directory with another revision
82 82 outgoing show changesets not found in the destination
83 83 parents show the parents of the working directory or revision
84 84 paths show aliases for remote repositories
85 85 phase set or show the current phase name
86 86 pull pull changes from the specified source
87 87 push push changes to the specified destination
88 88 recover roll back an interrupted transaction
89 89 remove remove the specified files on the next commit
90 90 rename rename files; equivalent of copy + remove
91 91 resolve redo merges or set/view the merge status of files
92 92 revert restore files to their checkout state
93 93 root print the root (top) of the current working directory
94 94 serve start stand-alone webserver
95 95 status show changed files in the working directory
96 96 summary summarize working directory state
97 97 tag add one or more tags for the current or given revision
98 98 tags list repository tags
99 99 unbundle apply one or more changegroup files
100 100 update update working directory (or switch revisions)
101 101 verify verify the integrity of the repository
102 102 version output version and copyright information
103 103
104 104 additional help topics:
105 105
106 106 config Configuration Files
107 107 dates Date Formats
108 108 diffs Diff Formats
109 109 environment Environment Variables
110 110 extensions Using Additional Features
111 111 filesets Specifying File Sets
112 112 glossary Glossary
113 113 hgignore Syntax for Mercurial Ignore Files
114 114 hgweb Configuring hgweb
115 115 merge-tools Merge Tools
116 116 multirevs Specifying Multiple Revisions
117 117 patterns File Name Patterns
118 118 phases Working with Phases
119 119 revisions Specifying Single Revisions
120 120 revsets Specifying Revision Sets
121 121 subrepos Subrepositories
122 122 templating Template Usage
123 123 urls URL Paths
124 124
125 125 use "hg -v help" to show builtin aliases and global options
126 126
127 127 $ hg -q help
128 128 add add the specified files on the next commit
129 129 addremove add all new files, delete all missing files
130 130 annotate show changeset information by line for each file
131 131 archive create an unversioned archive of a repository revision
132 132 backout reverse effect of earlier changeset
133 133 bisect subdivision search of changesets
134 134 bookmarks track a line of development with movable markers
135 135 branch set or show the current branch name
136 136 branches list repository named branches
137 137 bundle create a changegroup file
138 138 cat output the current or given revision of files
139 139 clone make a copy of an existing repository
140 140 commit commit the specified files or all outstanding changes
141 141 config show combined config settings from all hgrc files
142 142 copy mark files as copied for the next commit
143 143 diff diff repository (or selected files)
144 144 export dump the header and diffs for one or more changesets
145 145 forget forget the specified files on the next commit
146 146 graft copy changes from other branches onto the current branch
147 147 grep search for a pattern in specified files and revisions
148 148 heads show branch heads
149 149 help show help for a given topic or a help overview
150 150 identify identify the working copy or specified revision
151 151 import import an ordered set of patches
152 152 incoming show new changesets found in source
153 153 init create a new repository in the given directory
154 154 locate locate files matching specific patterns
155 155 log show revision history of entire repository or files
156 156 manifest output the current or given revision of the project manifest
157 157 merge merge working directory with another revision
158 158 outgoing show changesets not found in the destination
159 159 parents show the parents of the working directory or revision
160 160 paths show aliases for remote repositories
161 161 phase set or show the current phase name
162 162 pull pull changes from the specified source
163 163 push push changes to the specified destination
164 164 recover roll back an interrupted transaction
165 165 remove remove the specified files on the next commit
166 166 rename rename files; equivalent of copy + remove
167 167 resolve redo merges or set/view the merge status of files
168 168 revert restore files to their checkout state
169 169 root print the root (top) of the current working directory
170 170 serve start stand-alone webserver
171 171 status show changed files in the working directory
172 172 summary summarize working directory state
173 173 tag add one or more tags for the current or given revision
174 174 tags list repository tags
175 175 unbundle apply one or more changegroup files
176 176 update update working directory (or switch revisions)
177 177 verify verify the integrity of the repository
178 178 version output version and copyright information
179 179
180 180 additional help topics:
181 181
182 182 config Configuration Files
183 183 dates Date Formats
184 184 diffs Diff Formats
185 185 environment Environment Variables
186 186 extensions Using Additional Features
187 187 filesets Specifying File Sets
188 188 glossary Glossary
189 189 hgignore Syntax for Mercurial Ignore Files
190 190 hgweb Configuring hgweb
191 191 merge-tools Merge Tools
192 192 multirevs Specifying Multiple Revisions
193 193 patterns File Name Patterns
194 194 phases Working with Phases
195 195 revisions Specifying Single Revisions
196 196 revsets Specifying Revision Sets
197 197 subrepos Subrepositories
198 198 templating Template Usage
199 199 urls URL Paths
200 200
201 201 Test extension help:
202 202 $ hg help extensions --config extensions.rebase= --config extensions.children=
203 203 Using Additional Features
204 204 """""""""""""""""""""""""
205 205
206 206 Mercurial has the ability to add new features through the use of
207 207 extensions. Extensions may add new commands, add options to existing
208 208 commands, change the default behavior of commands, or implement hooks.
209 209
210 210 To enable the "foo" extension, either shipped with Mercurial or in the
211 211 Python search path, create an entry for it in your configuration file,
212 212 like this:
213 213
214 214 [extensions]
215 215 foo =
216 216
217 217 You may also specify the full path to an extension:
218 218
219 219 [extensions]
220 220 myfeature = ~/.hgext/myfeature.py
221 221
222 222 See "hg help config" for more information on configuration files.
223 223
224 224 Extensions are not loaded by default for a variety of reasons: they can
225 225 increase startup overhead; they may be meant for advanced usage only; they
226 226 may provide potentially dangerous abilities (such as letting you destroy
227 227 or modify history); they might not be ready for prime time; or they may
228 228 alter some usual behaviors of stock Mercurial. It is thus up to the user
229 229 to activate extensions as needed.
230 230
231 231 To explicitly disable an extension enabled in a configuration file of
232 232 broader scope, prepend its path with !:
233 233
234 234 [extensions]
235 235 # disabling extension bar residing in /path/to/extension/bar.py
236 236 bar = !/path/to/extension/bar.py
237 237 # ditto, but no path was supplied for extension baz
238 238 baz = !
239 239
240 240 enabled extensions:
241 241
242 242 children command to display child changesets (DEPRECATED)
243 243 rebase command to move sets of revisions to a different ancestor
244 244
245 245 disabled extensions:
246 246
247 247 acl hooks for controlling repository access
248 248 blackbox log repository events to a blackbox for debugging
249 249 bugzilla hooks for integrating with the Bugzilla bug tracker
250 250 churn command to display statistics about repository history
251 251 color colorize output from some commands
252 252 convert import revisions from foreign VCS repositories into
253 253 Mercurial
254 254 eol automatically manage newlines in repository files
255 255 extdiff command to allow external programs to compare revisions
256 256 factotum http authentication with factotum
257 257 gpg commands to sign and verify changesets
258 258 hgcia hooks for integrating with the CIA.vc notification service
259 259 hgk browse the repository in a graphical way
260 260 highlight syntax highlighting for hgweb (requires Pygments)
261 261 histedit interactive history editing
262 262 keyword expand keywords in tracked files
263 263 largefiles track large binary files
264 264 mq manage a stack of patches
265 265 notify hooks for sending email push notifications
266 266 pager browse command output with an external pager
267 267 patchbomb command to send changesets as (a series of) patch emails
268 268 progress show progress bars for some actions
269 269 purge command to delete untracked files from the working
270 270 directory
271 271 record commands to interactively select changes for
272 272 commit/qrefresh
273 273 relink recreates hardlinks between repository clones
274 274 schemes extend schemes with shortcuts to repository swarms
275 275 share share a common history between several working directories
276 276 shelve save and restore changes to the working directory
277 277 strip strip changesets and their descendents from history
278 278 transplant command to transplant changesets from another branch
279 279 win32mbcs allow the use of MBCS paths with problematic encodings
280 280 zeroconf discover and advertise repositories on the local network
281 281 Test short command list with verbose option
282 282
283 283 $ hg -v help shortlist
284 284 Mercurial Distributed SCM
285 285
286 286 basic commands:
287 287
288 288 add add the specified files on the next commit
289 289 annotate, blame
290 290 show changeset information by line for each file
291 291 clone make a copy of an existing repository
292 292 commit, ci commit the specified files or all outstanding changes
293 293 diff diff repository (or selected files)
294 294 export dump the header and diffs for one or more changesets
295 295 forget forget the specified files on the next commit
296 296 init create a new repository in the given directory
297 297 log, history show revision history of entire repository or files
298 298 merge merge working directory with another revision
299 299 pull pull changes from the specified source
300 300 push push changes to the specified destination
301 301 remove, rm remove the specified files on the next commit
302 302 serve start stand-alone webserver
303 303 status, st show changed files in the working directory
304 304 summary, sum summarize working directory state
305 305 update, up, checkout, co
306 306 update working directory (or switch revisions)
307 307
308 308 global options:
309 309
310 310 -R --repository REPO repository root directory or name of overlay bundle
311 311 file
312 312 --cwd DIR change working directory
313 313 -y --noninteractive do not prompt, automatically pick the first choice for
314 314 all prompts
315 315 -q --quiet suppress output
316 316 -v --verbose enable additional output
317 317 --config CONFIG [+] set/override config option (use 'section.name=value')
318 318 --debug enable debugging output
319 319 --debugger start debugger
320 320 --encoding ENCODE set the charset encoding (default: ascii)
321 321 --encodingmode MODE set the charset encoding mode (default: strict)
322 322 --traceback always print a traceback on exception
323 323 --time time how long the command takes
324 324 --profile print command execution profile
325 325 --version output version information and exit
326 326 -h --help display help and exit
327 327 --hidden consider hidden changesets
328 328
329 329 [+] marked option can be specified multiple times
330 330
331 331 use "hg help" for the full list of commands
332 332
333 333 $ hg add -h
334 334 hg add [OPTION]... [FILE]...
335 335
336 336 add the specified files on the next commit
337 337
338 338 Schedule files to be version controlled and added to the repository.
339 339
340 340 The files will be added to the repository at the next commit. To undo an
341 341 add before that, see "hg forget".
342 342
343 343 If no names are given, add all files to the repository.
344 344
345 345 Returns 0 if all files are successfully added.
346 346
347 347 options:
348 348
349 349 -I --include PATTERN [+] include names matching the given patterns
350 350 -X --exclude PATTERN [+] exclude names matching the given patterns
351 351 -S --subrepos recurse into subrepositories
352 352 -n --dry-run do not perform actions, just print output
353 353
354 354 [+] marked option can be specified multiple times
355 355
356 356 use "hg -v help add" to show more complete help and the global options
357 357
358 358 Verbose help for add
359 359
360 360 $ hg add -hv
361 361 hg add [OPTION]... [FILE]...
362 362
363 363 add the specified files on the next commit
364 364
365 365 Schedule files to be version controlled and added to the repository.
366 366
367 367 The files will be added to the repository at the next commit. To undo an
368 368 add before that, see "hg forget".
369 369
370 370 If no names are given, add all files to the repository.
371 371
372 372 An example showing how new (unknown) files are added automatically by "hg
373 373 add":
374 374
375 375 $ ls
376 376 foo.c
377 377 $ hg status
378 378 ? foo.c
379 379 $ hg add
380 380 adding foo.c
381 381 $ hg status
382 382 A foo.c
383 383
384 384 Returns 0 if all files are successfully added.
385 385
386 386 options:
387 387
388 388 -I --include PATTERN [+] include names matching the given patterns
389 389 -X --exclude PATTERN [+] exclude names matching the given patterns
390 390 -S --subrepos recurse into subrepositories
391 391 -n --dry-run do not perform actions, just print output
392 392
393 393 [+] marked option can be specified multiple times
394 394
395 395 global options:
396 396
397 397 -R --repository REPO repository root directory or name of overlay bundle
398 398 file
399 399 --cwd DIR change working directory
400 400 -y --noninteractive do not prompt, automatically pick the first choice for
401 401 all prompts
402 402 -q --quiet suppress output
403 403 -v --verbose enable additional output
404 404 --config CONFIG [+] set/override config option (use 'section.name=value')
405 405 --debug enable debugging output
406 406 --debugger start debugger
407 407 --encoding ENCODE set the charset encoding (default: ascii)
408 408 --encodingmode MODE set the charset encoding mode (default: strict)
409 409 --traceback always print a traceback on exception
410 410 --time time how long the command takes
411 411 --profile print command execution profile
412 412 --version output version information and exit
413 413 -h --help display help and exit
414 414 --hidden consider hidden changesets
415 415
416 416 [+] marked option can be specified multiple times
417 417
418 418 Test help option with version option
419 419
420 420 $ hg add -h --version
421 421 Mercurial Distributed SCM (version *) (glob)
422 422 (see http://mercurial.selenic.com for more information)
423 423
424 424 Copyright (C) 2005-2014 Matt Mackall and others
425 425 This is free software; see the source for copying conditions. There is NO
426 426 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
427 427
428 428 $ hg add --skjdfks
429 429 hg add: option --skjdfks not recognized
430 430 hg add [OPTION]... [FILE]...
431 431
432 432 add the specified files on the next commit
433 433
434 434 options:
435 435
436 436 -I --include PATTERN [+] include names matching the given patterns
437 437 -X --exclude PATTERN [+] exclude names matching the given patterns
438 438 -S --subrepos recurse into subrepositories
439 439 -n --dry-run do not perform actions, just print output
440 440
441 441 [+] marked option can be specified multiple times
442 442
443 443 use "hg help add" to show the full help text
444 444 [255]
445 445
446 446 Test ambiguous command help
447 447
448 448 $ hg help ad
449 449 list of commands:
450 450
451 451 add add the specified files on the next commit
452 452 addremove add all new files, delete all missing files
453 453
454 454 use "hg -v help ad" to show builtin aliases and global options
455 455
456 456 Test command without options
457 457
458 458 $ hg help verify
459 459 hg verify
460 460
461 461 verify the integrity of the repository
462 462
463 463 Verify the integrity of the current repository.
464 464
465 465 This will perform an extensive check of the repository's integrity,
466 466 validating the hashes and checksums of each entry in the changelog,
467 467 manifest, and tracked files, as well as the integrity of their crosslinks
468 468 and indices.
469 469
470 470 Please see http://mercurial.selenic.com/wiki/RepositoryCorruption for more
471 471 information about recovery from corruption of the repository.
472 472
473 473 Returns 0 on success, 1 if errors are encountered.
474 474
475 475 use "hg -v help verify" to show the global options
476 476
477 477 $ hg help diff
478 478 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
479 479
480 480 diff repository (or selected files)
481 481
482 482 Show differences between revisions for the specified files.
483 483
484 484 Differences between files are shown using the unified diff format.
485 485
486 486 Note:
487 487 diff may generate unexpected results for merges, as it will default to
488 488 comparing against the working directory's first parent changeset if no
489 489 revisions are specified.
490 490
491 491 When two revision arguments are given, then changes are shown between
492 492 those revisions. If only one revision is specified then that revision is
493 493 compared to the working directory, and, when no revisions are specified,
494 494 the working directory files are compared to its parent.
495 495
496 496 Alternatively you can specify -c/--change with a revision to see the
497 497 changes in that changeset relative to its first parent.
498 498
499 499 Without the -a/--text option, diff will avoid generating diffs of files it
500 500 detects as binary. With -a, diff will generate a diff anyway, probably
501 501 with undesirable results.
502 502
503 503 Use the -g/--git option to generate diffs in the git extended diff format.
504 504 For more information, read "hg help diffs".
505 505
506 506 Returns 0 on success.
507 507
508 508 options:
509 509
510 510 -r --rev REV [+] revision
511 511 -c --change REV change made by revision
512 512 -a --text treat all files as text
513 513 -g --git use git extended diff format
514 514 --nodates omit dates from diff headers
515 515 -p --show-function show which function each change is in
516 516 --reverse produce a diff that undoes the changes
517 517 -w --ignore-all-space ignore white space when comparing lines
518 518 -b --ignore-space-change ignore changes in the amount of white space
519 519 -B --ignore-blank-lines ignore changes whose lines are all blank
520 520 -U --unified NUM number of lines of context to show
521 521 --stat output diffstat-style summary of changes
522 522 -I --include PATTERN [+] include names matching the given patterns
523 523 -X --exclude PATTERN [+] exclude names matching the given patterns
524 524 -S --subrepos recurse into subrepositories
525 525
526 526 [+] marked option can be specified multiple times
527 527
528 528 use "hg -v help diff" to show more complete help and the global options
529 529
530 530 $ hg help status
531 531 hg status [OPTION]... [FILE]...
532 532
533 533 aliases: st
534 534
535 535 show changed files in the working directory
536 536
537 537 Show status of files in the repository. If names are given, only files
538 538 that match are shown. Files that are clean or ignored or the source of a
539 539 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
540 540 -C/--copies or -A/--all are given. Unless options described with "show
541 541 only ..." are given, the options -mardu are used.
542 542
543 543 Option -q/--quiet hides untracked (unknown and ignored) files unless
544 544 explicitly requested with -u/--unknown or -i/--ignored.
545 545
546 546 Note:
547 547 status may appear to disagree with diff if permissions have changed or
548 548 a merge has occurred. The standard diff format does not report
549 549 permission changes and diff only reports changes relative to one merge
550 550 parent.
551 551
552 552 If one revision is given, it is used as the base revision. If two
553 553 revisions are given, the differences between them are shown. The --change
554 554 option can also be used as a shortcut to list the changed files of a
555 555 revision from its first parent.
556 556
557 557 The codes used to show the status of files are:
558 558
559 559 M = modified
560 560 A = added
561 561 R = removed
562 562 C = clean
563 563 ! = missing (deleted by non-hg command, but still tracked)
564 564 ? = not tracked
565 565 I = ignored
566 566 = origin of the previous file (with --copies)
567 567
568 568 Returns 0 on success.
569 569
570 570 options:
571 571
572 572 -A --all show status of all files
573 573 -m --modified show only modified files
574 574 -a --added show only added files
575 575 -r --removed show only removed files
576 576 -d --deleted show only deleted (but tracked) files
577 577 -c --clean show only files without changes
578 578 -u --unknown show only unknown (not tracked) files
579 579 -i --ignored show only ignored files
580 580 -n --no-status hide status prefix
581 581 -C --copies show source of copied files
582 582 -0 --print0 end filenames with NUL, for use with xargs
583 583 --rev REV [+] show difference from revision
584 584 --change REV list the changed files of a revision
585 585 -I --include PATTERN [+] include names matching the given patterns
586 586 -X --exclude PATTERN [+] exclude names matching the given patterns
587 587 -S --subrepos recurse into subrepositories
588 588
589 589 [+] marked option can be specified multiple times
590 590
591 591 use "hg -v help status" to show more complete help and the global options
592 592
593 593 $ hg -q help status
594 594 hg status [OPTION]... [FILE]...
595 595
596 596 show changed files in the working directory
597 597
598 598 $ hg help foo
599 599 hg: unknown command 'foo'
600 600 Mercurial Distributed SCM
601 601
602 602 basic commands:
603 603
604 604 add add the specified files on the next commit
605 605 annotate show changeset information by line for each file
606 606 clone make a copy of an existing repository
607 607 commit commit the specified files or all outstanding changes
608 608 diff diff repository (or selected files)
609 609 export dump the header and diffs for one or more changesets
610 610 forget forget the specified files on the next commit
611 611 init create a new repository in the given directory
612 612 log show revision history of entire repository or files
613 613 merge merge working directory with another revision
614 614 pull pull changes from the specified source
615 615 push push changes to the specified destination
616 616 remove remove the specified files on the next commit
617 617 serve start stand-alone webserver
618 618 status show changed files in the working directory
619 619 summary summarize working directory state
620 620 update update working directory (or switch revisions)
621 621
622 622 use "hg help" for the full list of commands or "hg -v" for details
623 623 [255]
624 624
625 625 $ hg skjdfks
626 626 hg: unknown command 'skjdfks'
627 627 Mercurial Distributed SCM
628 628
629 629 basic commands:
630 630
631 631 add add the specified files on the next commit
632 632 annotate show changeset information by line for each file
633 633 clone make a copy of an existing repository
634 634 commit commit the specified files or all outstanding changes
635 635 diff diff repository (or selected files)
636 636 export dump the header and diffs for one or more changesets
637 637 forget forget the specified files on the next commit
638 638 init create a new repository in the given directory
639 639 log show revision history of entire repository or files
640 640 merge merge working directory with another revision
641 641 pull pull changes from the specified source
642 642 push push changes to the specified destination
643 643 remove remove the specified files on the next commit
644 644 serve start stand-alone webserver
645 645 status show changed files in the working directory
646 646 summary summarize working directory state
647 647 update update working directory (or switch revisions)
648 648
649 649 use "hg help" for the full list of commands or "hg -v" for details
650 650 [255]
651 651
652 652
653 653 $ cat > helpext.py <<EOF
654 654 > import os
655 > from mercurial import commands
655 > from mercurial import cmdutil, commands
656 >
657 > cmdtable = {}
658 > command = cmdutil.command(cmdtable)
656 659 >
660 > @command('nohelp',
661 > [('', 'longdesc', 3, 'x'*90),
662 > ('n', '', None, 'normal desc'),
663 > ('', 'newline', '', 'line1\nline2')],
664 > 'hg nohelp')
665 > @command('debugoptDEP', [('', 'dopt', None, 'option is DEPRECATED')])
657 666 > def nohelp(ui, *args, **kwargs):
658 667 > pass
659 668 >
660 > cmdtable = {
661 > "debugoptDEP": (nohelp, [('', 'dopt', None, 'option is DEPRECATED')],),
662 > "nohelp": (nohelp, [('', 'longdesc', 3, 'x'*90),
663 > ('n', '', None, 'normal desc'),
664 > ('', 'newline', '', 'line1\nline2'),
665 > ], "hg nohelp"),
666 > }
667 >
668 669 > commands.norepo += ' nohelp'
669 670 > EOF
670 671 $ echo '[extensions]' >> $HGRCPATH
671 672 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
672 673
673 674 Test command with no help text
674 675
675 676 $ hg help nohelp
676 677 hg nohelp
677 678
678 679 (no help text available)
679 680
680 681 options:
681 682
682 683 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
683 684 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
684 685 -n -- normal desc
685 686 --newline VALUE line1 line2
686 687
687 688 use "hg -v help nohelp" to show the global options
688 689
689 690 $ hg help -k nohelp
690 691 Commands:
691 692
692 693 nohelp hg nohelp
693 694
694 695 Extension Commands:
695 696
696 697 nohelp (no help text available)
697 698
698 699 Test that default list of commands omits extension commands
699 700
700 701 $ hg help
701 702 Mercurial Distributed SCM
702 703
703 704 list of commands:
704 705
705 706 add add the specified files on the next commit
706 707 addremove add all new files, delete all missing files
707 708 annotate show changeset information by line for each file
708 709 archive create an unversioned archive of a repository revision
709 710 backout reverse effect of earlier changeset
710 711 bisect subdivision search of changesets
711 712 bookmarks track a line of development with movable markers
712 713 branch set or show the current branch name
713 714 branches list repository named branches
714 715 bundle create a changegroup file
715 716 cat output the current or given revision of files
716 717 clone make a copy of an existing repository
717 718 commit commit the specified files or all outstanding changes
718 719 config show combined config settings from all hgrc files
719 720 copy mark files as copied for the next commit
720 721 diff diff repository (or selected files)
721 722 export dump the header and diffs for one or more changesets
722 723 forget forget the specified files on the next commit
723 724 graft copy changes from other branches onto the current branch
724 725 grep search for a pattern in specified files and revisions
725 726 heads show branch heads
726 727 help show help for a given topic or a help overview
727 728 identify identify the working copy or specified revision
728 729 import import an ordered set of patches
729 730 incoming show new changesets found in source
730 731 init create a new repository in the given directory
731 732 locate locate files matching specific patterns
732 733 log show revision history of entire repository or files
733 734 manifest output the current or given revision of the project manifest
734 735 merge merge working directory with another revision
735 736 outgoing show changesets not found in the destination
736 737 parents show the parents of the working directory or revision
737 738 paths show aliases for remote repositories
738 739 phase set or show the current phase name
739 740 pull pull changes from the specified source
740 741 push push changes to the specified destination
741 742 recover roll back an interrupted transaction
742 743 remove remove the specified files on the next commit
743 744 rename rename files; equivalent of copy + remove
744 745 resolve redo merges or set/view the merge status of files
745 746 revert restore files to their checkout state
746 747 root print the root (top) of the current working directory
747 748 serve start stand-alone webserver
748 749 status show changed files in the working directory
749 750 summary summarize working directory state
750 751 tag add one or more tags for the current or given revision
751 752 tags list repository tags
752 753 unbundle apply one or more changegroup files
753 754 update update working directory (or switch revisions)
754 755 verify verify the integrity of the repository
755 756 version output version and copyright information
756 757
757 758 enabled extensions:
758 759
759 760 helpext (no help text available)
760 761
761 762 additional help topics:
762 763
763 764 config Configuration Files
764 765 dates Date Formats
765 766 diffs Diff Formats
766 767 environment Environment Variables
767 768 extensions Using Additional Features
768 769 filesets Specifying File Sets
769 770 glossary Glossary
770 771 hgignore Syntax for Mercurial Ignore Files
771 772 hgweb Configuring hgweb
772 773 merge-tools Merge Tools
773 774 multirevs Specifying Multiple Revisions
774 775 patterns File Name Patterns
775 776 phases Working with Phases
776 777 revisions Specifying Single Revisions
777 778 revsets Specifying Revision Sets
778 779 subrepos Subrepositories
779 780 templating Template Usage
780 781 urls URL Paths
781 782
782 783 use "hg -v help" to show builtin aliases and global options
783 784
784 785
785 786 Test list of internal help commands
786 787
787 788 $ hg help debug
788 789 debug commands (internal and unsupported):
789 790
790 791 debugancestor
791 792 find the ancestor revision of two revisions in a given index
792 793 debugbuilddag
793 794 builds a repo with a given DAG from scratch in the current
794 795 empty repo
795 796 debugbundle lists the contents of a bundle
796 797 debugcheckstate
797 798 validate the correctness of the current dirstate
798 799 debugcommands
799 800 list all available commands and options
800 801 debugcomplete
801 802 returns the completion list associated with the given command
802 803 debugdag format the changelog or an index DAG as a concise textual
803 804 description
804 805 debugdata dump the contents of a data file revision
805 806 debugdate parse and display a date
806 807 debugdirstate
807 808 show the contents of the current dirstate
808 809 debugdiscovery
809 810 runs the changeset discovery protocol in isolation
810 811 debugfileset parse and apply a fileset specification
811 812 debugfsinfo show information detected about current filesystem
812 813 debuggetbundle
813 814 retrieves a bundle from a repo
814 815 debugignore display the combined ignore pattern
815 816 debugindex dump the contents of an index file
816 817 debugindexdot
817 818 dump an index DAG as a graphviz dot file
818 819 debuginstall test Mercurial installation
819 820 debugknown test whether node ids are known to a repo
820 821 debuglabelcomplete
821 822 complete "labels" - tags, open branch names, bookmark names
822 823 debugobsolete
823 824 create arbitrary obsolete marker
824 825 debugoptDEP (no help text available)
825 826 debugpathcomplete
826 827 complete part or all of a tracked path
827 828 debugpushkey access the pushkey key/value protocol
828 829 debugpvec (no help text available)
829 830 debugrebuilddirstate
830 831 rebuild the dirstate as it would look like for the given
831 832 revision
832 833 debugrename dump rename information
833 834 debugrevlog show data and statistics about a revlog
834 835 debugrevspec parse and apply a revision specification
835 836 debugsetparents
836 837 manually set the parents of the current working directory
837 838 debugsub (no help text available)
838 839 debugsuccessorssets
839 840 show set of successors for revision
840 841 debugwalk show how files match on given patterns
841 842 debugwireargs
842 843 (no help text available)
843 844
844 845 use "hg -v help debug" to show builtin aliases and global options
845 846
846 847
847 848 Test list of commands with command with no help text
848 849
849 850 $ hg help helpext
850 851 helpext extension - no help text available
851 852
852 853 list of commands:
853 854
854 855 nohelp (no help text available)
855 856
856 857 use "hg -v help helpext" to show builtin aliases and global options
857 858
858 859
859 860 test deprecated option is hidden in command help
860 861 $ hg help debugoptDEP
861 862 hg debugoptDEP
862 863
863 864 (no help text available)
864 865
865 866 options:
866 867
867 868 use "hg -v help debugoptDEP" to show the global options
868 869
869 870 test deprecated option is shown with -v
870 871 $ hg help -v debugoptDEP | grep dopt
871 872 --dopt option is DEPRECATED
872 873
873 874 #if gettext
874 875 test deprecated option is hidden with translation with untranslated description
875 876 (use many globy for not failing on changed transaction)
876 877 $ LANGUAGE=sv hg help debugoptDEP
877 878 hg debugoptDEP
878 879
879 880 (*) (glob)
880 881
881 882 flaggor:
882 883
883 884 *"hg -v help debugoptDEP"* (glob)
884 885 #endif
885 886
886 887 Test a help topic
887 888
888 889 $ hg help revs
889 890 Specifying Single Revisions
890 891 """""""""""""""""""""""""""
891 892
892 893 Mercurial supports several ways to specify individual revisions.
893 894
894 895 A plain integer is treated as a revision number. Negative integers are
895 896 treated as sequential offsets from the tip, with -1 denoting the tip, -2
896 897 denoting the revision prior to the tip, and so forth.
897 898
898 899 A 40-digit hexadecimal string is treated as a unique revision identifier.
899 900
900 901 A hexadecimal string less than 40 characters long is treated as a unique
901 902 revision identifier and is referred to as a short-form identifier. A
902 903 short-form identifier is only valid if it is the prefix of exactly one
903 904 full-length identifier.
904 905
905 906 Any other string is treated as a bookmark, tag, or branch name. A bookmark
906 907 is a movable pointer to a revision. A tag is a permanent name associated
907 908 with a revision. A branch name denotes the tipmost open branch head of
908 909 that branch - or if they are all closed, the tipmost closed head of the
909 910 branch. Bookmark, tag, and branch names must not contain the ":"
910 911 character.
911 912
912 913 The reserved name "tip" always identifies the most recent revision.
913 914
914 915 The reserved name "null" indicates the null revision. This is the revision
915 916 of an empty repository, and the parent of revision 0.
916 917
917 918 The reserved name "." indicates the working directory parent. If no
918 919 working directory is checked out, it is equivalent to null. If an
919 920 uncommitted merge is in progress, "." is the revision of the first parent.
920 921
921 922 Test templating help
922 923
923 924 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
924 925 desc String. The text of the changeset description.
925 926 diffstat String. Statistics of changes with the following format:
926 927 firstline Any text. Returns the first line of text.
927 928 nonempty Any text. Returns '(none)' if the string is empty.
928 929
929 930 Test help hooks
930 931
931 932 $ cat > helphook1.py <<EOF
932 933 > from mercurial import help
933 934 >
934 935 > def rewrite(topic, doc):
935 936 > return doc + '\nhelphook1\n'
936 937 >
937 938 > def extsetup(ui):
938 939 > help.addtopichook('revsets', rewrite)
939 940 > EOF
940 941 $ cat > helphook2.py <<EOF
941 942 > from mercurial import help
942 943 >
943 944 > def rewrite(topic, doc):
944 945 > return doc + '\nhelphook2\n'
945 946 >
946 947 > def extsetup(ui):
947 948 > help.addtopichook('revsets', rewrite)
948 949 > EOF
949 950 $ echo '[extensions]' >> $HGRCPATH
950 951 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
951 952 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
952 953 $ hg help revsets | grep helphook
953 954 helphook1
954 955 helphook2
955 956
956 957 Test keyword search help
957 958
958 959 $ cat > prefixedname.py <<EOF
959 960 > '''matched against word "clone"
960 961 > '''
961 962 > EOF
962 963 $ echo '[extensions]' >> $HGRCPATH
963 964 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
964 965 $ hg help -k clone
965 966 Topics:
966 967
967 968 config Configuration Files
968 969 extensions Using Additional Features
969 970 glossary Glossary
970 971 phases Working with Phases
971 972 subrepos Subrepositories
972 973 urls URL Paths
973 974
974 975 Commands:
975 976
976 977 bookmarks track a line of development with movable markers
977 978 clone make a copy of an existing repository
978 979 paths show aliases for remote repositories
979 980 update update working directory (or switch revisions)
980 981
981 982 Extensions:
982 983
983 984 prefixedname matched against word "clone"
984 985 relink recreates hardlinks between repository clones
985 986
986 987 Extension Commands:
987 988
988 989 qclone clone main and patch repository at same time
989 990
990 991 Test omit indicating for help
991 992
992 993 $ cat > addverboseitems.py <<EOF
993 994 > '''extension to test omit indicating.
994 995 >
995 996 > This paragraph is never omitted (for extension)
996 997 >
997 998 > .. container:: verbose
998 999 >
999 1000 > This paragraph is omitted,
1000 1001 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for extension)
1001 1002 >
1002 1003 > This paragraph is never omitted, too (for extension)
1003 1004 > '''
1004 1005 >
1005 1006 > from mercurial import help, commands
1006 1007 > testtopic = """This paragraph is never omitted (for topic).
1007 1008 >
1008 1009 > .. container:: verbose
1009 1010 >
1010 1011 > This paragraph is omitted,
1011 1012 > if :hg:\`help\` is invoked witout \`\`-v\`\` (for topic)
1012 1013 >
1013 1014 > This paragraph is never omitted, too (for topic)
1014 1015 > """
1015 1016 > def extsetup(ui):
1016 1017 > help.helptable.append((["topic-containing-verbose"],
1017 1018 > "This is the topic to test omit indicating.",
1018 1019 > lambda : testtopic))
1019 1020 > EOF
1020 1021 $ echo '[extensions]' >> $HGRCPATH
1021 1022 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1022 1023 $ hg help addverboseitems
1023 1024 addverboseitems extension - extension to test omit indicating.
1024 1025
1025 1026 This paragraph is never omitted (for extension)
1026 1027
1027 1028 This paragraph is never omitted, too (for extension)
1028 1029
1029 1030 use "hg help -v addverboseitems" to show more complete help
1030 1031
1031 1032 no commands defined
1032 1033 $ hg help -v addverboseitems
1033 1034 addverboseitems extension - extension to test omit indicating.
1034 1035
1035 1036 This paragraph is never omitted (for extension)
1036 1037
1037 1038 This paragraph is omitted, if "hg help" is invoked witout "-v" (for extension)
1038 1039
1039 1040 This paragraph is never omitted, too (for extension)
1040 1041
1041 1042 no commands defined
1042 1043 $ hg help topic-containing-verbose
1043 1044 This is the topic to test omit indicating.
1044 1045 """"""""""""""""""""""""""""""""""""""""""
1045 1046
1046 1047 This paragraph is never omitted (for topic).
1047 1048
1048 1049 This paragraph is never omitted, too (for topic)
1049 1050
1050 1051 use "hg help -v topic-containing-verbose" to show more complete help
1051 1052 $ hg help -v topic-containing-verbose
1052 1053 This is the topic to test omit indicating.
1053 1054 """"""""""""""""""""""""""""""""""""""""""
1054 1055
1055 1056 This paragraph is never omitted (for topic).
1056 1057
1057 1058 This paragraph is omitted, if "hg help" is invoked witout "-v" (for topic)
1058 1059
1059 1060 This paragraph is never omitted, too (for topic)
1060 1061
1061 1062 Test usage of section marks in help documents
1062 1063
1063 1064 $ cd "$TESTDIR"/../doc
1064 1065 $ python check-seclevel.py
1065 1066 $ cd $TESTTMP
1066 1067
1067 1068 #if serve
1068 1069
1069 1070 Test the help pages in hgweb.
1070 1071
1071 1072 Dish up an empty repo; serve it cold.
1072 1073
1073 1074 $ hg init "$TESTTMP/test"
1074 1075 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1075 1076 $ cat hg.pid >> $DAEMON_PIDS
1076 1077
1077 1078 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help"
1078 1079 200 Script output follows
1079 1080
1080 1081 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1081 1082 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1082 1083 <head>
1083 1084 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1084 1085 <meta name="robots" content="index, nofollow" />
1085 1086 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1086 1087 <script type="text/javascript" src="/static/mercurial.js"></script>
1087 1088
1088 1089 <title>Help: Index</title>
1089 1090 </head>
1090 1091 <body>
1091 1092
1092 1093 <div class="container">
1093 1094 <div class="menu">
1094 1095 <div class="logo">
1095 1096 <a href="http://mercurial.selenic.com/">
1096 1097 <img src="/static/hglogo.png" alt="mercurial" /></a>
1097 1098 </div>
1098 1099 <ul>
1099 1100 <li><a href="/shortlog">log</a></li>
1100 1101 <li><a href="/graph">graph</a></li>
1101 1102 <li><a href="/tags">tags</a></li>
1102 1103 <li><a href="/bookmarks">bookmarks</a></li>
1103 1104 <li><a href="/branches">branches</a></li>
1104 1105 </ul>
1105 1106 <ul>
1106 1107 <li class="active">help</li>
1107 1108 </ul>
1108 1109 </div>
1109 1110
1110 1111 <div class="main">
1111 1112 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1112 1113 <form class="search" action="/log">
1113 1114
1114 1115 <p><input name="rev" id="search1" type="text" size="30" /></p>
1115 1116 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1116 1117 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1117 1118 </form>
1118 1119 <table class="bigtable">
1119 1120 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
1120 1121
1121 1122 <tr><td>
1122 1123 <a href="/help/config">
1123 1124 config
1124 1125 </a>
1125 1126 </td><td>
1126 1127 Configuration Files
1127 1128 </td></tr>
1128 1129 <tr><td>
1129 1130 <a href="/help/dates">
1130 1131 dates
1131 1132 </a>
1132 1133 </td><td>
1133 1134 Date Formats
1134 1135 </td></tr>
1135 1136 <tr><td>
1136 1137 <a href="/help/diffs">
1137 1138 diffs
1138 1139 </a>
1139 1140 </td><td>
1140 1141 Diff Formats
1141 1142 </td></tr>
1142 1143 <tr><td>
1143 1144 <a href="/help/environment">
1144 1145 environment
1145 1146 </a>
1146 1147 </td><td>
1147 1148 Environment Variables
1148 1149 </td></tr>
1149 1150 <tr><td>
1150 1151 <a href="/help/extensions">
1151 1152 extensions
1152 1153 </a>
1153 1154 </td><td>
1154 1155 Using Additional Features
1155 1156 </td></tr>
1156 1157 <tr><td>
1157 1158 <a href="/help/filesets">
1158 1159 filesets
1159 1160 </a>
1160 1161 </td><td>
1161 1162 Specifying File Sets
1162 1163 </td></tr>
1163 1164 <tr><td>
1164 1165 <a href="/help/glossary">
1165 1166 glossary
1166 1167 </a>
1167 1168 </td><td>
1168 1169 Glossary
1169 1170 </td></tr>
1170 1171 <tr><td>
1171 1172 <a href="/help/hgignore">
1172 1173 hgignore
1173 1174 </a>
1174 1175 </td><td>
1175 1176 Syntax for Mercurial Ignore Files
1176 1177 </td></tr>
1177 1178 <tr><td>
1178 1179 <a href="/help/hgweb">
1179 1180 hgweb
1180 1181 </a>
1181 1182 </td><td>
1182 1183 Configuring hgweb
1183 1184 </td></tr>
1184 1185 <tr><td>
1185 1186 <a href="/help/merge-tools">
1186 1187 merge-tools
1187 1188 </a>
1188 1189 </td><td>
1189 1190 Merge Tools
1190 1191 </td></tr>
1191 1192 <tr><td>
1192 1193 <a href="/help/multirevs">
1193 1194 multirevs
1194 1195 </a>
1195 1196 </td><td>
1196 1197 Specifying Multiple Revisions
1197 1198 </td></tr>
1198 1199 <tr><td>
1199 1200 <a href="/help/patterns">
1200 1201 patterns
1201 1202 </a>
1202 1203 </td><td>
1203 1204 File Name Patterns
1204 1205 </td></tr>
1205 1206 <tr><td>
1206 1207 <a href="/help/phases">
1207 1208 phases
1208 1209 </a>
1209 1210 </td><td>
1210 1211 Working with Phases
1211 1212 </td></tr>
1212 1213 <tr><td>
1213 1214 <a href="/help/revisions">
1214 1215 revisions
1215 1216 </a>
1216 1217 </td><td>
1217 1218 Specifying Single Revisions
1218 1219 </td></tr>
1219 1220 <tr><td>
1220 1221 <a href="/help/revsets">
1221 1222 revsets
1222 1223 </a>
1223 1224 </td><td>
1224 1225 Specifying Revision Sets
1225 1226 </td></tr>
1226 1227 <tr><td>
1227 1228 <a href="/help/subrepos">
1228 1229 subrepos
1229 1230 </a>
1230 1231 </td><td>
1231 1232 Subrepositories
1232 1233 </td></tr>
1233 1234 <tr><td>
1234 1235 <a href="/help/templating">
1235 1236 templating
1236 1237 </a>
1237 1238 </td><td>
1238 1239 Template Usage
1239 1240 </td></tr>
1240 1241 <tr><td>
1241 1242 <a href="/help/urls">
1242 1243 urls
1243 1244 </a>
1244 1245 </td><td>
1245 1246 URL Paths
1246 1247 </td></tr>
1247 1248 <tr><td>
1248 1249 <a href="/help/topic-containing-verbose">
1249 1250 topic-containing-verbose
1250 1251 </a>
1251 1252 </td><td>
1252 1253 This is the topic to test omit indicating.
1253 1254 </td></tr>
1254 1255
1255 1256 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1256 1257
1257 1258 <tr><td>
1258 1259 <a href="/help/add">
1259 1260 add
1260 1261 </a>
1261 1262 </td><td>
1262 1263 add the specified files on the next commit
1263 1264 </td></tr>
1264 1265 <tr><td>
1265 1266 <a href="/help/annotate">
1266 1267 annotate
1267 1268 </a>
1268 1269 </td><td>
1269 1270 show changeset information by line for each file
1270 1271 </td></tr>
1271 1272 <tr><td>
1272 1273 <a href="/help/clone">
1273 1274 clone
1274 1275 </a>
1275 1276 </td><td>
1276 1277 make a copy of an existing repository
1277 1278 </td></tr>
1278 1279 <tr><td>
1279 1280 <a href="/help/commit">
1280 1281 commit
1281 1282 </a>
1282 1283 </td><td>
1283 1284 commit the specified files or all outstanding changes
1284 1285 </td></tr>
1285 1286 <tr><td>
1286 1287 <a href="/help/diff">
1287 1288 diff
1288 1289 </a>
1289 1290 </td><td>
1290 1291 diff repository (or selected files)
1291 1292 </td></tr>
1292 1293 <tr><td>
1293 1294 <a href="/help/export">
1294 1295 export
1295 1296 </a>
1296 1297 </td><td>
1297 1298 dump the header and diffs for one or more changesets
1298 1299 </td></tr>
1299 1300 <tr><td>
1300 1301 <a href="/help/forget">
1301 1302 forget
1302 1303 </a>
1303 1304 </td><td>
1304 1305 forget the specified files on the next commit
1305 1306 </td></tr>
1306 1307 <tr><td>
1307 1308 <a href="/help/init">
1308 1309 init
1309 1310 </a>
1310 1311 </td><td>
1311 1312 create a new repository in the given directory
1312 1313 </td></tr>
1313 1314 <tr><td>
1314 1315 <a href="/help/log">
1315 1316 log
1316 1317 </a>
1317 1318 </td><td>
1318 1319 show revision history of entire repository or files
1319 1320 </td></tr>
1320 1321 <tr><td>
1321 1322 <a href="/help/merge">
1322 1323 merge
1323 1324 </a>
1324 1325 </td><td>
1325 1326 merge working directory with another revision
1326 1327 </td></tr>
1327 1328 <tr><td>
1328 1329 <a href="/help/pull">
1329 1330 pull
1330 1331 </a>
1331 1332 </td><td>
1332 1333 pull changes from the specified source
1333 1334 </td></tr>
1334 1335 <tr><td>
1335 1336 <a href="/help/push">
1336 1337 push
1337 1338 </a>
1338 1339 </td><td>
1339 1340 push changes to the specified destination
1340 1341 </td></tr>
1341 1342 <tr><td>
1342 1343 <a href="/help/remove">
1343 1344 remove
1344 1345 </a>
1345 1346 </td><td>
1346 1347 remove the specified files on the next commit
1347 1348 </td></tr>
1348 1349 <tr><td>
1349 1350 <a href="/help/serve">
1350 1351 serve
1351 1352 </a>
1352 1353 </td><td>
1353 1354 start stand-alone webserver
1354 1355 </td></tr>
1355 1356 <tr><td>
1356 1357 <a href="/help/status">
1357 1358 status
1358 1359 </a>
1359 1360 </td><td>
1360 1361 show changed files in the working directory
1361 1362 </td></tr>
1362 1363 <tr><td>
1363 1364 <a href="/help/summary">
1364 1365 summary
1365 1366 </a>
1366 1367 </td><td>
1367 1368 summarize working directory state
1368 1369 </td></tr>
1369 1370 <tr><td>
1370 1371 <a href="/help/update">
1371 1372 update
1372 1373 </a>
1373 1374 </td><td>
1374 1375 update working directory (or switch revisions)
1375 1376 </td></tr>
1376 1377
1377 1378 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1378 1379
1379 1380 <tr><td>
1380 1381 <a href="/help/addremove">
1381 1382 addremove
1382 1383 </a>
1383 1384 </td><td>
1384 1385 add all new files, delete all missing files
1385 1386 </td></tr>
1386 1387 <tr><td>
1387 1388 <a href="/help/archive">
1388 1389 archive
1389 1390 </a>
1390 1391 </td><td>
1391 1392 create an unversioned archive of a repository revision
1392 1393 </td></tr>
1393 1394 <tr><td>
1394 1395 <a href="/help/backout">
1395 1396 backout
1396 1397 </a>
1397 1398 </td><td>
1398 1399 reverse effect of earlier changeset
1399 1400 </td></tr>
1400 1401 <tr><td>
1401 1402 <a href="/help/bisect">
1402 1403 bisect
1403 1404 </a>
1404 1405 </td><td>
1405 1406 subdivision search of changesets
1406 1407 </td></tr>
1407 1408 <tr><td>
1408 1409 <a href="/help/bookmarks">
1409 1410 bookmarks
1410 1411 </a>
1411 1412 </td><td>
1412 1413 track a line of development with movable markers
1413 1414 </td></tr>
1414 1415 <tr><td>
1415 1416 <a href="/help/branch">
1416 1417 branch
1417 1418 </a>
1418 1419 </td><td>
1419 1420 set or show the current branch name
1420 1421 </td></tr>
1421 1422 <tr><td>
1422 1423 <a href="/help/branches">
1423 1424 branches
1424 1425 </a>
1425 1426 </td><td>
1426 1427 list repository named branches
1427 1428 </td></tr>
1428 1429 <tr><td>
1429 1430 <a href="/help/bundle">
1430 1431 bundle
1431 1432 </a>
1432 1433 </td><td>
1433 1434 create a changegroup file
1434 1435 </td></tr>
1435 1436 <tr><td>
1436 1437 <a href="/help/cat">
1437 1438 cat
1438 1439 </a>
1439 1440 </td><td>
1440 1441 output the current or given revision of files
1441 1442 </td></tr>
1442 1443 <tr><td>
1443 1444 <a href="/help/config">
1444 1445 config
1445 1446 </a>
1446 1447 </td><td>
1447 1448 show combined config settings from all hgrc files
1448 1449 </td></tr>
1449 1450 <tr><td>
1450 1451 <a href="/help/copy">
1451 1452 copy
1452 1453 </a>
1453 1454 </td><td>
1454 1455 mark files as copied for the next commit
1455 1456 </td></tr>
1456 1457 <tr><td>
1457 1458 <a href="/help/graft">
1458 1459 graft
1459 1460 </a>
1460 1461 </td><td>
1461 1462 copy changes from other branches onto the current branch
1462 1463 </td></tr>
1463 1464 <tr><td>
1464 1465 <a href="/help/grep">
1465 1466 grep
1466 1467 </a>
1467 1468 </td><td>
1468 1469 search for a pattern in specified files and revisions
1469 1470 </td></tr>
1470 1471 <tr><td>
1471 1472 <a href="/help/heads">
1472 1473 heads
1473 1474 </a>
1474 1475 </td><td>
1475 1476 show branch heads
1476 1477 </td></tr>
1477 1478 <tr><td>
1478 1479 <a href="/help/help">
1479 1480 help
1480 1481 </a>
1481 1482 </td><td>
1482 1483 show help for a given topic or a help overview
1483 1484 </td></tr>
1484 1485 <tr><td>
1485 1486 <a href="/help/identify">
1486 1487 identify
1487 1488 </a>
1488 1489 </td><td>
1489 1490 identify the working copy or specified revision
1490 1491 </td></tr>
1491 1492 <tr><td>
1492 1493 <a href="/help/import">
1493 1494 import
1494 1495 </a>
1495 1496 </td><td>
1496 1497 import an ordered set of patches
1497 1498 </td></tr>
1498 1499 <tr><td>
1499 1500 <a href="/help/incoming">
1500 1501 incoming
1501 1502 </a>
1502 1503 </td><td>
1503 1504 show new changesets found in source
1504 1505 </td></tr>
1505 1506 <tr><td>
1506 1507 <a href="/help/locate">
1507 1508 locate
1508 1509 </a>
1509 1510 </td><td>
1510 1511 locate files matching specific patterns
1511 1512 </td></tr>
1512 1513 <tr><td>
1513 1514 <a href="/help/manifest">
1514 1515 manifest
1515 1516 </a>
1516 1517 </td><td>
1517 1518 output the current or given revision of the project manifest
1518 1519 </td></tr>
1519 1520 <tr><td>
1520 1521 <a href="/help/nohelp">
1521 1522 nohelp
1522 1523 </a>
1523 1524 </td><td>
1524 1525 (no help text available)
1525 1526 </td></tr>
1526 1527 <tr><td>
1527 1528 <a href="/help/outgoing">
1528 1529 outgoing
1529 1530 </a>
1530 1531 </td><td>
1531 1532 show changesets not found in the destination
1532 1533 </td></tr>
1533 1534 <tr><td>
1534 1535 <a href="/help/parents">
1535 1536 parents
1536 1537 </a>
1537 1538 </td><td>
1538 1539 show the parents of the working directory or revision
1539 1540 </td></tr>
1540 1541 <tr><td>
1541 1542 <a href="/help/paths">
1542 1543 paths
1543 1544 </a>
1544 1545 </td><td>
1545 1546 show aliases for remote repositories
1546 1547 </td></tr>
1547 1548 <tr><td>
1548 1549 <a href="/help/phase">
1549 1550 phase
1550 1551 </a>
1551 1552 </td><td>
1552 1553 set or show the current phase name
1553 1554 </td></tr>
1554 1555 <tr><td>
1555 1556 <a href="/help/recover">
1556 1557 recover
1557 1558 </a>
1558 1559 </td><td>
1559 1560 roll back an interrupted transaction
1560 1561 </td></tr>
1561 1562 <tr><td>
1562 1563 <a href="/help/rename">
1563 1564 rename
1564 1565 </a>
1565 1566 </td><td>
1566 1567 rename files; equivalent of copy + remove
1567 1568 </td></tr>
1568 1569 <tr><td>
1569 1570 <a href="/help/resolve">
1570 1571 resolve
1571 1572 </a>
1572 1573 </td><td>
1573 1574 redo merges or set/view the merge status of files
1574 1575 </td></tr>
1575 1576 <tr><td>
1576 1577 <a href="/help/revert">
1577 1578 revert
1578 1579 </a>
1579 1580 </td><td>
1580 1581 restore files to their checkout state
1581 1582 </td></tr>
1582 1583 <tr><td>
1583 1584 <a href="/help/root">
1584 1585 root
1585 1586 </a>
1586 1587 </td><td>
1587 1588 print the root (top) of the current working directory
1588 1589 </td></tr>
1589 1590 <tr><td>
1590 1591 <a href="/help/tag">
1591 1592 tag
1592 1593 </a>
1593 1594 </td><td>
1594 1595 add one or more tags for the current or given revision
1595 1596 </td></tr>
1596 1597 <tr><td>
1597 1598 <a href="/help/tags">
1598 1599 tags
1599 1600 </a>
1600 1601 </td><td>
1601 1602 list repository tags
1602 1603 </td></tr>
1603 1604 <tr><td>
1604 1605 <a href="/help/unbundle">
1605 1606 unbundle
1606 1607 </a>
1607 1608 </td><td>
1608 1609 apply one or more changegroup files
1609 1610 </td></tr>
1610 1611 <tr><td>
1611 1612 <a href="/help/verify">
1612 1613 verify
1613 1614 </a>
1614 1615 </td><td>
1615 1616 verify the integrity of the repository
1616 1617 </td></tr>
1617 1618 <tr><td>
1618 1619 <a href="/help/version">
1619 1620 version
1620 1621 </a>
1621 1622 </td><td>
1622 1623 output version and copyright information
1623 1624 </td></tr>
1624 1625 </table>
1625 1626 </div>
1626 1627 </div>
1627 1628
1628 1629 <script type="text/javascript">process_dates()</script>
1629 1630
1630 1631
1631 1632 </body>
1632 1633 </html>
1633 1634
1634 1635
1635 1636 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/add"
1636 1637 200 Script output follows
1637 1638
1638 1639 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1639 1640 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1640 1641 <head>
1641 1642 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1642 1643 <meta name="robots" content="index, nofollow" />
1643 1644 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1644 1645 <script type="text/javascript" src="/static/mercurial.js"></script>
1645 1646
1646 1647 <title>Help: add</title>
1647 1648 </head>
1648 1649 <body>
1649 1650
1650 1651 <div class="container">
1651 1652 <div class="menu">
1652 1653 <div class="logo">
1653 1654 <a href="http://mercurial.selenic.com/">
1654 1655 <img src="/static/hglogo.png" alt="mercurial" /></a>
1655 1656 </div>
1656 1657 <ul>
1657 1658 <li><a href="/shortlog">log</a></li>
1658 1659 <li><a href="/graph">graph</a></li>
1659 1660 <li><a href="/tags">tags</a></li>
1660 1661 <li><a href="/bookmarks">bookmarks</a></li>
1661 1662 <li><a href="/branches">branches</a></li>
1662 1663 </ul>
1663 1664 <ul>
1664 1665 <li class="active"><a href="/help">help</a></li>
1665 1666 </ul>
1666 1667 </div>
1667 1668
1668 1669 <div class="main">
1669 1670 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1670 1671 <h3>Help: add</h3>
1671 1672
1672 1673 <form class="search" action="/log">
1673 1674
1674 1675 <p><input name="rev" id="search1" type="text" size="30" /></p>
1675 1676 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1676 1677 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1677 1678 </form>
1678 1679 <div id="doc">
1679 1680 <p>
1680 1681 hg add [OPTION]... [FILE]...
1681 1682 </p>
1682 1683 <p>
1683 1684 add the specified files on the next commit
1684 1685 </p>
1685 1686 <p>
1686 1687 Schedule files to be version controlled and added to the
1687 1688 repository.
1688 1689 </p>
1689 1690 <p>
1690 1691 The files will be added to the repository at the next commit. To
1691 1692 undo an add before that, see &quot;hg forget&quot;.
1692 1693 </p>
1693 1694 <p>
1694 1695 If no names are given, add all files to the repository.
1695 1696 </p>
1696 1697 <p>
1697 1698 An example showing how new (unknown) files are added
1698 1699 automatically by &quot;hg add&quot;:
1699 1700 </p>
1700 1701 <pre>
1701 1702 \$ ls (re)
1702 1703 foo.c
1703 1704 \$ hg status (re)
1704 1705 ? foo.c
1705 1706 \$ hg add (re)
1706 1707 adding foo.c
1707 1708 \$ hg status (re)
1708 1709 A foo.c
1709 1710 </pre>
1710 1711 <p>
1711 1712 Returns 0 if all files are successfully added.
1712 1713 </p>
1713 1714 <p>
1714 1715 options:
1715 1716 </p>
1716 1717 <table>
1717 1718 <tr><td>-I</td>
1718 1719 <td>--include PATTERN [+]</td>
1719 1720 <td>include names matching the given patterns</td></tr>
1720 1721 <tr><td>-X</td>
1721 1722 <td>--exclude PATTERN [+]</td>
1722 1723 <td>exclude names matching the given patterns</td></tr>
1723 1724 <tr><td>-S</td>
1724 1725 <td>--subrepos</td>
1725 1726 <td>recurse into subrepositories</td></tr>
1726 1727 <tr><td>-n</td>
1727 1728 <td>--dry-run</td>
1728 1729 <td>do not perform actions, just print output</td></tr>
1729 1730 </table>
1730 1731 <p>
1731 1732 [+] marked option can be specified multiple times
1732 1733 </p>
1733 1734 <p>
1734 1735 global options:
1735 1736 </p>
1736 1737 <table>
1737 1738 <tr><td>-R</td>
1738 1739 <td>--repository REPO</td>
1739 1740 <td>repository root directory or name of overlay bundle file</td></tr>
1740 1741 <tr><td></td>
1741 1742 <td>--cwd DIR</td>
1742 1743 <td>change working directory</td></tr>
1743 1744 <tr><td>-y</td>
1744 1745 <td>--noninteractive</td>
1745 1746 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1746 1747 <tr><td>-q</td>
1747 1748 <td>--quiet</td>
1748 1749 <td>suppress output</td></tr>
1749 1750 <tr><td>-v</td>
1750 1751 <td>--verbose</td>
1751 1752 <td>enable additional output</td></tr>
1752 1753 <tr><td></td>
1753 1754 <td>--config CONFIG [+]</td>
1754 1755 <td>set/override config option (use 'section.name=value')</td></tr>
1755 1756 <tr><td></td>
1756 1757 <td>--debug</td>
1757 1758 <td>enable debugging output</td></tr>
1758 1759 <tr><td></td>
1759 1760 <td>--debugger</td>
1760 1761 <td>start debugger</td></tr>
1761 1762 <tr><td></td>
1762 1763 <td>--encoding ENCODE</td>
1763 1764 <td>set the charset encoding (default: ascii)</td></tr>
1764 1765 <tr><td></td>
1765 1766 <td>--encodingmode MODE</td>
1766 1767 <td>set the charset encoding mode (default: strict)</td></tr>
1767 1768 <tr><td></td>
1768 1769 <td>--traceback</td>
1769 1770 <td>always print a traceback on exception</td></tr>
1770 1771 <tr><td></td>
1771 1772 <td>--time</td>
1772 1773 <td>time how long the command takes</td></tr>
1773 1774 <tr><td></td>
1774 1775 <td>--profile</td>
1775 1776 <td>print command execution profile</td></tr>
1776 1777 <tr><td></td>
1777 1778 <td>--version</td>
1778 1779 <td>output version information and exit</td></tr>
1779 1780 <tr><td>-h</td>
1780 1781 <td>--help</td>
1781 1782 <td>display help and exit</td></tr>
1782 1783 <tr><td></td>
1783 1784 <td>--hidden</td>
1784 1785 <td>consider hidden changesets</td></tr>
1785 1786 </table>
1786 1787 <p>
1787 1788 [+] marked option can be specified multiple times
1788 1789 </p>
1789 1790
1790 1791 </div>
1791 1792 </div>
1792 1793 </div>
1793 1794
1794 1795 <script type="text/javascript">process_dates()</script>
1795 1796
1796 1797
1797 1798 </body>
1798 1799 </html>
1799 1800
1800 1801
1801 1802 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/remove"
1802 1803 200 Script output follows
1803 1804
1804 1805 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1805 1806 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1806 1807 <head>
1807 1808 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1808 1809 <meta name="robots" content="index, nofollow" />
1809 1810 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1810 1811 <script type="text/javascript" src="/static/mercurial.js"></script>
1811 1812
1812 1813 <title>Help: remove</title>
1813 1814 </head>
1814 1815 <body>
1815 1816
1816 1817 <div class="container">
1817 1818 <div class="menu">
1818 1819 <div class="logo">
1819 1820 <a href="http://mercurial.selenic.com/">
1820 1821 <img src="/static/hglogo.png" alt="mercurial" /></a>
1821 1822 </div>
1822 1823 <ul>
1823 1824 <li><a href="/shortlog">log</a></li>
1824 1825 <li><a href="/graph">graph</a></li>
1825 1826 <li><a href="/tags">tags</a></li>
1826 1827 <li><a href="/bookmarks">bookmarks</a></li>
1827 1828 <li><a href="/branches">branches</a></li>
1828 1829 </ul>
1829 1830 <ul>
1830 1831 <li class="active"><a href="/help">help</a></li>
1831 1832 </ul>
1832 1833 </div>
1833 1834
1834 1835 <div class="main">
1835 1836 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1836 1837 <h3>Help: remove</h3>
1837 1838
1838 1839 <form class="search" action="/log">
1839 1840
1840 1841 <p><input name="rev" id="search1" type="text" size="30" /></p>
1841 1842 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1842 1843 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1843 1844 </form>
1844 1845 <div id="doc">
1845 1846 <p>
1846 1847 hg remove [OPTION]... FILE...
1847 1848 </p>
1848 1849 <p>
1849 1850 aliases: rm
1850 1851 </p>
1851 1852 <p>
1852 1853 remove the specified files on the next commit
1853 1854 </p>
1854 1855 <p>
1855 1856 Schedule the indicated files for removal from the current branch.
1856 1857 </p>
1857 1858 <p>
1858 1859 This command schedules the files to be removed at the next commit.
1859 1860 To undo a remove before that, see &quot;hg revert&quot;. To undo added
1860 1861 files, see &quot;hg forget&quot;.
1861 1862 </p>
1862 1863 <p>
1863 1864 -A/--after can be used to remove only files that have already
1864 1865 been deleted, -f/--force can be used to force deletion, and -Af
1865 1866 can be used to remove files from the next revision without
1866 1867 deleting them from the working directory.
1867 1868 </p>
1868 1869 <p>
1869 1870 The following table details the behavior of remove for different
1870 1871 file states (columns) and option combinations (rows). The file
1871 1872 states are Added [A], Clean [C], Modified [M] and Missing [!]
1872 1873 (as reported by &quot;hg status&quot;). The actions are Warn, Remove
1873 1874 (from branch) and Delete (from disk):
1874 1875 </p>
1875 1876 <table>
1876 1877 <tr><td>opt/state</td>
1877 1878 <td>A</td>
1878 1879 <td>C</td>
1879 1880 <td>M</td>
1880 1881 <td>!</td></tr>
1881 1882 <tr><td>none</td>
1882 1883 <td>W</td>
1883 1884 <td>RD</td>
1884 1885 <td>W</td>
1885 1886 <td>R</td></tr>
1886 1887 <tr><td>-f</td>
1887 1888 <td>R</td>
1888 1889 <td>RD</td>
1889 1890 <td>RD</td>
1890 1891 <td>R</td></tr>
1891 1892 <tr><td>-A</td>
1892 1893 <td>W</td>
1893 1894 <td>W</td>
1894 1895 <td>W</td>
1895 1896 <td>R</td></tr>
1896 1897 <tr><td>-Af</td>
1897 1898 <td>R</td>
1898 1899 <td>R</td>
1899 1900 <td>R</td>
1900 1901 <td>R</td></tr>
1901 1902 </table>
1902 1903 <p>
1903 1904 Note that remove never deletes files in Added [A] state from the
1904 1905 working directory, not even if option --force is specified.
1905 1906 </p>
1906 1907 <p>
1907 1908 Returns 0 on success, 1 if any warnings encountered.
1908 1909 </p>
1909 1910 <p>
1910 1911 options:
1911 1912 </p>
1912 1913 <table>
1913 1914 <tr><td>-A</td>
1914 1915 <td>--after</td>
1915 1916 <td>record delete for missing files</td></tr>
1916 1917 <tr><td>-f</td>
1917 1918 <td>--force</td>
1918 1919 <td>remove (and delete) file even if added or modified</td></tr>
1919 1920 <tr><td>-I</td>
1920 1921 <td>--include PATTERN [+]</td>
1921 1922 <td>include names matching the given patterns</td></tr>
1922 1923 <tr><td>-X</td>
1923 1924 <td>--exclude PATTERN [+]</td>
1924 1925 <td>exclude names matching the given patterns</td></tr>
1925 1926 </table>
1926 1927 <p>
1927 1928 [+] marked option can be specified multiple times
1928 1929 </p>
1929 1930 <p>
1930 1931 global options:
1931 1932 </p>
1932 1933 <table>
1933 1934 <tr><td>-R</td>
1934 1935 <td>--repository REPO</td>
1935 1936 <td>repository root directory or name of overlay bundle file</td></tr>
1936 1937 <tr><td></td>
1937 1938 <td>--cwd DIR</td>
1938 1939 <td>change working directory</td></tr>
1939 1940 <tr><td>-y</td>
1940 1941 <td>--noninteractive</td>
1941 1942 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
1942 1943 <tr><td>-q</td>
1943 1944 <td>--quiet</td>
1944 1945 <td>suppress output</td></tr>
1945 1946 <tr><td>-v</td>
1946 1947 <td>--verbose</td>
1947 1948 <td>enable additional output</td></tr>
1948 1949 <tr><td></td>
1949 1950 <td>--config CONFIG [+]</td>
1950 1951 <td>set/override config option (use 'section.name=value')</td></tr>
1951 1952 <tr><td></td>
1952 1953 <td>--debug</td>
1953 1954 <td>enable debugging output</td></tr>
1954 1955 <tr><td></td>
1955 1956 <td>--debugger</td>
1956 1957 <td>start debugger</td></tr>
1957 1958 <tr><td></td>
1958 1959 <td>--encoding ENCODE</td>
1959 1960 <td>set the charset encoding (default: ascii)</td></tr>
1960 1961 <tr><td></td>
1961 1962 <td>--encodingmode MODE</td>
1962 1963 <td>set the charset encoding mode (default: strict)</td></tr>
1963 1964 <tr><td></td>
1964 1965 <td>--traceback</td>
1965 1966 <td>always print a traceback on exception</td></tr>
1966 1967 <tr><td></td>
1967 1968 <td>--time</td>
1968 1969 <td>time how long the command takes</td></tr>
1969 1970 <tr><td></td>
1970 1971 <td>--profile</td>
1971 1972 <td>print command execution profile</td></tr>
1972 1973 <tr><td></td>
1973 1974 <td>--version</td>
1974 1975 <td>output version information and exit</td></tr>
1975 1976 <tr><td>-h</td>
1976 1977 <td>--help</td>
1977 1978 <td>display help and exit</td></tr>
1978 1979 <tr><td></td>
1979 1980 <td>--hidden</td>
1980 1981 <td>consider hidden changesets</td></tr>
1981 1982 </table>
1982 1983 <p>
1983 1984 [+] marked option can be specified multiple times
1984 1985 </p>
1985 1986
1986 1987 </div>
1987 1988 </div>
1988 1989 </div>
1989 1990
1990 1991 <script type="text/javascript">process_dates()</script>
1991 1992
1992 1993
1993 1994 </body>
1994 1995 </html>
1995 1996
1996 1997
1997 1998 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/revisions"
1998 1999 200 Script output follows
1999 2000
2000 2001 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2001 2002 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2002 2003 <head>
2003 2004 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2004 2005 <meta name="robots" content="index, nofollow" />
2005 2006 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2006 2007 <script type="text/javascript" src="/static/mercurial.js"></script>
2007 2008
2008 2009 <title>Help: revisions</title>
2009 2010 </head>
2010 2011 <body>
2011 2012
2012 2013 <div class="container">
2013 2014 <div class="menu">
2014 2015 <div class="logo">
2015 2016 <a href="http://mercurial.selenic.com/">
2016 2017 <img src="/static/hglogo.png" alt="mercurial" /></a>
2017 2018 </div>
2018 2019 <ul>
2019 2020 <li><a href="/shortlog">log</a></li>
2020 2021 <li><a href="/graph">graph</a></li>
2021 2022 <li><a href="/tags">tags</a></li>
2022 2023 <li><a href="/bookmarks">bookmarks</a></li>
2023 2024 <li><a href="/branches">branches</a></li>
2024 2025 </ul>
2025 2026 <ul>
2026 2027 <li class="active"><a href="/help">help</a></li>
2027 2028 </ul>
2028 2029 </div>
2029 2030
2030 2031 <div class="main">
2031 2032 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2032 2033 <h3>Help: revisions</h3>
2033 2034
2034 2035 <form class="search" action="/log">
2035 2036
2036 2037 <p><input name="rev" id="search1" type="text" size="30" /></p>
2037 2038 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2038 2039 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2039 2040 </form>
2040 2041 <div id="doc">
2041 2042 <h1>Specifying Single Revisions</h1>
2042 2043 <p>
2043 2044 Mercurial supports several ways to specify individual revisions.
2044 2045 </p>
2045 2046 <p>
2046 2047 A plain integer is treated as a revision number. Negative integers are
2047 2048 treated as sequential offsets from the tip, with -1 denoting the tip,
2048 2049 -2 denoting the revision prior to the tip, and so forth.
2049 2050 </p>
2050 2051 <p>
2051 2052 A 40-digit hexadecimal string is treated as a unique revision
2052 2053 identifier.
2053 2054 </p>
2054 2055 <p>
2055 2056 A hexadecimal string less than 40 characters long is treated as a
2056 2057 unique revision identifier and is referred to as a short-form
2057 2058 identifier. A short-form identifier is only valid if it is the prefix
2058 2059 of exactly one full-length identifier.
2059 2060 </p>
2060 2061 <p>
2061 2062 Any other string is treated as a bookmark, tag, or branch name. A
2062 2063 bookmark is a movable pointer to a revision. A tag is a permanent name
2063 2064 associated with a revision. A branch name denotes the tipmost open branch head
2064 2065 of that branch - or if they are all closed, the tipmost closed head of the
2065 2066 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot; character.
2066 2067 </p>
2067 2068 <p>
2068 2069 The reserved name &quot;tip&quot; always identifies the most recent revision.
2069 2070 </p>
2070 2071 <p>
2071 2072 The reserved name &quot;null&quot; indicates the null revision. This is the
2072 2073 revision of an empty repository, and the parent of revision 0.
2073 2074 </p>
2074 2075 <p>
2075 2076 The reserved name &quot;.&quot; indicates the working directory parent. If no
2076 2077 working directory is checked out, it is equivalent to null. If an
2077 2078 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
2078 2079 parent.
2079 2080 </p>
2080 2081
2081 2082 </div>
2082 2083 </div>
2083 2084 </div>
2084 2085
2085 2086 <script type="text/javascript">process_dates()</script>
2086 2087
2087 2088
2088 2089 </body>
2089 2090 </html>
2090 2091
2091 2092
2092 2093 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
2093 2094
2094 2095 #endif
@@ -1,239 +1,240 b''
1 1
2 2 $ cat > loop.py <<EOF
3 > from mercurial import commands
3 > from mercurial import cmdutil, commands
4 4 > import time
5 >
6 > cmdtable = {}
7 > command = cmdutil.command(cmdtable)
8 >
5 9 > class incrementingtime(object):
6 10 > def __init__(self):
7 11 > self._time = 0.0
8 12 > def __call__(self):
9 13 > self._time += 0.25
10 14 > return self._time
11 15 > time.time = incrementingtime()
12 16 >
17 > @command('loop',
18 > [('', 'total', '', 'override for total'),
19 > ('', 'nested', False, 'show nested results'),
20 > ('', 'parallel', False, 'show parallel sets of results')],
21 > 'hg loop LOOPS')
13 22 > def loop(ui, loops, **opts):
14 23 > loops = int(loops)
15 24 > total = None
16 25 > if loops >= 0:
17 26 > total = loops
18 27 > if opts.get('total', None):
19 28 > total = int(opts.get('total'))
20 29 > nested = False
21 30 > if opts.get('nested', None):
22 31 > nested = True
23 32 > loops = abs(loops)
24 33 >
25 34 > for i in range(loops):
26 35 > ui.progress('loop', i, 'loop.%d' % i, 'loopnum', total)
27 36 > if opts.get('parallel'):
28 37 > ui.progress('other', i, 'other.%d' % i, 'othernum', total)
29 38 > if nested:
30 39 > nested_steps = 2
31 40 > if i and i % 4 == 0:
32 41 > nested_steps = 5
33 42 > for j in range(nested_steps):
34 43 > ui.progress(
35 44 > 'nested', j, 'nested.%d' % j, 'nestnum', nested_steps)
36 45 > ui.progress(
37 46 > 'nested', None, 'nested.done', 'nestnum', nested_steps)
38 47 > ui.progress('loop', None, 'loop.done', 'loopnum', total)
39 48 >
40 49 > commands.norepo += " loop"
41 >
42 > cmdtable = {
43 > "loop": (loop, [('', 'total', '', 'override for total'),
44 > ('', 'nested', False, 'show nested results'),
45 > ('', 'parallel', False, 'show parallel sets of results'),
46 > ],
47 > 'hg loop LOOPS'),
48 > }
49 50 > EOF
50 51
51 52 $ cp $HGRCPATH $HGRCPATH.orig
52 53 $ echo "[extensions]" >> $HGRCPATH
53 54 $ echo "progress=" >> $HGRCPATH
54 55 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
55 56 $ echo "[progress]" >> $HGRCPATH
56 57 $ echo "format = topic bar number" >> $HGRCPATH
57 58 $ echo "assume-tty=1" >> $HGRCPATH
58 59 $ echo "width=60" >> $HGRCPATH
59 60
60 61 test default params, display nothing because of delay
61 62
62 63 $ hg -y loop 3
63 64 $ echo "delay=0" >> $HGRCPATH
64 65 $ echo "refresh=0" >> $HGRCPATH
65 66
66 67 test with delay=0, refresh=0
67 68
68 69 $ hg -y loop 3
69 70 \r (no-eol) (esc)
70 71 loop [ ] 0/3\r (no-eol) (esc)
71 72 loop [===============> ] 1/3\r (no-eol) (esc)
72 73 loop [===============================> ] 2/3\r (no-eol) (esc)
73 74 \r (no-eol) (esc)
74 75
75 76
76 77 test nested short-lived topics (which shouldn't display with nestdelay):
77 78
78 79 $ hg -y loop 3 --nested
79 80 \r (no-eol) (esc)
80 81 loop [ ] 0/3\r (no-eol) (esc)
81 82 loop [===============> ] 1/3\r (no-eol) (esc)
82 83 loop [===============================> ] 2/3\r (no-eol) (esc)
83 84 \r (no-eol) (esc)
84 85
85 86 Test nested long-lived topic which has the same name as a short-lived
86 87 peer. We shouldn't get stuck showing the short-lived inner steps, and
87 88 should go back to skipping the inner steps when the slow nested step
88 89 finishes.
89 90
90 91 $ hg -y loop 7 --nested
91 92 \r (no-eol) (esc)
92 93 loop [ ] 0/7\r (no-eol) (esc)
93 94 loop [=====> ] 1/7\r (no-eol) (esc)
94 95 loop [============> ] 2/7\r (no-eol) (esc)
95 96 loop [===================> ] 3/7\r (no-eol) (esc)
96 97 loop [==========================> ] 4/7\r (no-eol) (esc)
97 98 nested [==========================> ] 3/5\r (no-eol) (esc)
98 99 nested [===================================> ] 4/5\r (no-eol) (esc)
99 100 loop [=================================> ] 5/7\r (no-eol) (esc)
100 101 loop [========================================> ] 6/7\r (no-eol) (esc)
101 102 \r (no-eol) (esc)
102 103
103 104
104 105 $ hg --config progress.changedelay=0 -y loop 3 --nested
105 106 \r (no-eol) (esc)
106 107 loop [ ] 0/3\r (no-eol) (esc)
107 108 nested [ ] 0/2\r (no-eol) (esc)
108 109 nested [======================> ] 1/2\r (no-eol) (esc)
109 110 loop [===============> ] 1/3\r (no-eol) (esc)
110 111 nested [ ] 0/2\r (no-eol) (esc)
111 112 nested [======================> ] 1/2\r (no-eol) (esc)
112 113 loop [===============================> ] 2/3\r (no-eol) (esc)
113 114 nested [ ] 0/2\r (no-eol) (esc)
114 115 nested [======================> ] 1/2\r (no-eol) (esc)
115 116 \r (no-eol) (esc)
116 117
117 118
118 119 test two topics being printed in parallel (as when we're doing a local
119 120 --pull clone, where you get the unbundle and bundle progress at the
120 121 same time):
121 122 $ hg loop 3 --parallel
122 123 \r (no-eol) (esc)
123 124 loop [ ] 0/3\r (no-eol) (esc)
124 125 loop [===============> ] 1/3\r (no-eol) (esc)
125 126 loop [===============================> ] 2/3\r (no-eol) (esc)
126 127 \r (no-eol) (esc)
127 128 test refresh is taken in account
128 129
129 130 $ hg -y --config progress.refresh=100 loop 3
130 131
131 132 test format options 1
132 133
133 134 $ hg -y --config 'progress.format=number topic item+2' loop 2
134 135 \r (no-eol) (esc)
135 136 0/2 loop lo\r (no-eol) (esc)
136 137 1/2 loop lo\r (no-eol) (esc)
137 138 \r (no-eol) (esc)
138 139
139 140 test format options 2
140 141
141 142 $ hg -y --config 'progress.format=number item-3 bar' loop 2
142 143 \r (no-eol) (esc)
143 144 0/2 p.0 [ ]\r (no-eol) (esc)
144 145 1/2 p.1 [=======================> ]\r (no-eol) (esc)
145 146 \r (no-eol) (esc)
146 147
147 148 test format options and indeterminate progress
148 149
149 150 $ hg -y --config 'progress.format=number item bar' loop -- -2
150 151 \r (no-eol) (esc)
151 152 0 loop.0 [ <=> ]\r (no-eol) (esc)
152 153 1 loop.1 [ <=> ]\r (no-eol) (esc)
153 154 \r (no-eol) (esc)
154 155
155 156 make sure things don't fall over if count > total
156 157
157 158 $ hg -y loop --total 4 6
158 159 \r (no-eol) (esc)
159 160 loop [ ] 0/4\r (no-eol) (esc)
160 161 loop [===========> ] 1/4\r (no-eol) (esc)
161 162 loop [=======================> ] 2/4\r (no-eol) (esc)
162 163 loop [===================================> ] 3/4\r (no-eol) (esc)
163 164 loop [===============================================>] 4/4\r (no-eol) (esc)
164 165 loop [ <=> ] 5/4\r (no-eol) (esc)
165 166 \r (no-eol) (esc)
166 167
167 168 test immediate progress completion
168 169
169 170 $ hg -y loop 0
170 171
171 172 test delay time estimates
172 173
173 174 $ cat > mocktime.py <<EOF
174 175 > import os
175 176 > import time
176 177 >
177 178 > class mocktime(object):
178 179 > def __init__(self, increment):
179 180 > self.time = 0
180 181 > self.increment = increment
181 182 > def __call__(self):
182 183 > self.time += self.increment
183 184 > return self.time
184 185 >
185 186 > def uisetup(ui):
186 187 > time.time = mocktime(int(os.environ.get('MOCKTIME', '11')))
187 188 > EOF
188 189
189 190 $ cp $HGRCPATH.orig $HGRCPATH
190 191 $ echo "[extensions]" >> $HGRCPATH
191 192 $ echo "mocktime=`pwd`/mocktime.py" >> $HGRCPATH
192 193 $ echo "progress=" >> $HGRCPATH
193 194 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
194 195 $ echo "[progress]" >> $HGRCPATH
195 196 $ echo "assume-tty=1" >> $HGRCPATH
196 197 $ echo "delay=25" >> $HGRCPATH
197 198 $ echo "width=60" >> $HGRCPATH
198 199
199 200 $ hg -y loop 8
200 201 \r (no-eol) (esc)
201 202 loop [=========> ] 2/8 1m07s\r (no-eol) (esc)
202 203 loop [===============> ] 3/8 56s\r (no-eol) (esc)
203 204 loop [=====================> ] 4/8 45s\r (no-eol) (esc)
204 205 loop [==========================> ] 5/8 34s\r (no-eol) (esc)
205 206 loop [================================> ] 6/8 23s\r (no-eol) (esc)
206 207 loop [=====================================> ] 7/8 12s\r (no-eol) (esc)
207 208 \r (no-eol) (esc)
208 209
209 210 $ MOCKTIME=10000 hg -y loop 4
210 211 \r (no-eol) (esc)
211 212 loop [ ] 0/4\r (no-eol) (esc)
212 213 loop [=========> ] 1/4 8h21m\r (no-eol) (esc)
213 214 loop [====================> ] 2/4 5h34m\r (no-eol) (esc)
214 215 loop [==============================> ] 3/4 2h47m\r (no-eol) (esc)
215 216 \r (no-eol) (esc)
216 217
217 218 $ MOCKTIME=1000000 hg -y loop 4
218 219 \r (no-eol) (esc)
219 220 loop [ ] 0/4\r (no-eol) (esc)
220 221 loop [=========> ] 1/4 5w00d\r (no-eol) (esc)
221 222 loop [====================> ] 2/4 3w03d\r (no-eol) (esc)
222 223 loop [=============================> ] 3/4 11d14h\r (no-eol) (esc)
223 224 \r (no-eol) (esc)
224 225
225 226
226 227 $ MOCKTIME=14000000 hg -y loop 4
227 228 \r (no-eol) (esc)
228 229 loop [ ] 0/4\r (no-eol) (esc)
229 230 loop [=========> ] 1/4 1y18w\r (no-eol) (esc)
230 231 loop [===================> ] 2/4 46w03d\r (no-eol) (esc)
231 232 loop [=============================> ] 3/4 23w02d\r (no-eol) (esc)
232 233 \r (no-eol) (esc)
233 234
234 235 Time estimates should not fail when there's no end point:
235 236 $ hg -y loop -- -4
236 237 \r (no-eol) (esc)
237 238 loop [ <=> ] 2\r (no-eol) (esc)
238 239 loop [ <=> ] 3\r (no-eol) (esc)
239 240 \r (no-eol) (esc)
General Comments 0
You need to be logged in to leave comments. Login now