Show More
@@ -1268,6 +1268,23 b' def help_(ui, name=None, with_version=Fa' | |||||
1268 | commands it provides.""" |
|
1268 | commands it provides.""" | |
1269 | option_lists = [] |
|
1269 | option_lists = [] | |
1270 |
|
1270 | |||
|
1271 | def addglobalopts(aliases): | |||
|
1272 | if ui.verbose: | |||
|
1273 | option_lists.append((_("global options:"), globalopts)) | |||
|
1274 | if name == 'shortlist': | |||
|
1275 | option_lists.append((_('use "hg help" for the full list ' | |||
|
1276 | 'of commands'), ())) | |||
|
1277 | else: | |||
|
1278 | if name == 'shortlist': | |||
|
1279 | msg = _('use "hg help" for the full list of commands ' | |||
|
1280 | 'or "hg -v" for details') | |||
|
1281 | elif aliases: | |||
|
1282 | msg = _('use "hg -v help%s" to show aliases and ' | |||
|
1283 | 'global options') % (name and " " + name or "") | |||
|
1284 | else: | |||
|
1285 | msg = _('use "hg -v help %s" to show global options') % name | |||
|
1286 | option_lists.append((msg, ())) | |||
|
1287 | ||||
1271 | def helpcmd(name): |
|
1288 | def helpcmd(name): | |
1272 | if with_version: |
|
1289 | if with_version: | |
1273 | version_(ui) |
|
1290 | version_(ui) | |
@@ -1291,7 +1308,9 b' def help_(ui, name=None, with_version=Fa' | |||||
1291 |
|
1308 | |||
1292 | # options |
|
1309 | # options | |
1293 | if i[1]: |
|
1310 | if i[1]: | |
1294 | option_lists.append(("options", i[1])) |
|
1311 | option_lists.append((_("options:\n"), i[1])) | |
|
1312 | ||||
|
1313 | addglobalopts(False) | |||
1295 |
|
1314 | |||
1296 | def helplist(select=None): |
|
1315 | def helplist(select=None): | |
1297 | h = {} |
|
1316 | h = {} | |
@@ -1321,6 +1340,9 b' def help_(ui, name=None, with_version=Fa' | |||||
1321 | else: |
|
1340 | else: | |
1322 | ui.write(' %-*s %s\n' % (m, f, h[f])) |
|
1341 | ui.write(' %-*s %s\n' % (m, f, h[f])) | |
1323 |
|
1342 | |||
|
1343 | if not ui.quiet: | |||
|
1344 | addglobalopts(True) | |||
|
1345 | ||||
1324 | def helptopic(name): |
|
1346 | def helptopic(name): | |
1325 | v = None |
|
1347 | v = None | |
1326 | for i in help.helptable: |
|
1348 | for i in help.helptable: | |
@@ -1360,12 +1382,7 b' def help_(ui, name=None, with_version=Fa' | |||||
1360 | ui.status(_('no commands defined\n')) |
|
1382 | ui.status(_('no commands defined\n')) | |
1361 | return |
|
1383 | return | |
1362 |
|
1384 | |||
1363 | if ui.verbose: |
|
1385 | ui.status(_('list of commands:\n\n')) | |
1364 | ui.status(_('list of commands:\n\n')) |
|
|||
1365 | else: |
|
|||
1366 | ui.status(_('list of commands (use "hg help -v %s" ' |
|
|||
1367 | 'to show aliases and global options):\n\n') % name) |
|
|||
1368 |
|
||||
1369 | modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct]) |
|
1386 | modcmds = dict.fromkeys([c.split('|', 1)[0] for c in ct]) | |
1370 | helplist(modcmds.has_key) |
|
1387 | helplist(modcmds.has_key) | |
1371 |
|
1388 | |||
@@ -1391,24 +1408,16 b' def help_(ui, name=None, with_version=Fa' | |||||
1391 |
|
1408 | |||
1392 | # list of commands |
|
1409 | # list of commands | |
1393 | if name == "shortlist": |
|
1410 | if name == "shortlist": | |
1394 |
ui.status(_('basic commands |
|
1411 | ui.status(_('basic commands:\n\n')) | |
1395 | 'for the full list or option "-v" for details):\n\n')) |
|
1412 | else: | |
1396 | elif ui.verbose: |
|
|||
1397 | ui.status(_('list of commands:\n\n')) |
|
1413 | ui.status(_('list of commands:\n\n')) | |
1398 | else: |
|
|||
1399 | ui.status(_('list of commands (use "hg help -v" ' |
|
|||
1400 | 'to show aliases and global options):\n\n')) |
|
|||
1401 |
|
1414 | |||
1402 | helplist() |
|
1415 | helplist() | |
1403 |
|
1416 | |||
1404 | # global options |
|
|||
1405 | if ui.verbose: |
|
|||
1406 | option_lists.append(("global options", globalopts)) |
|
|||
1407 |
|
||||
1408 | # list all option lists |
|
1417 | # list all option lists | |
1409 | opt_output = [] |
|
1418 | opt_output = [] | |
1410 | for title, options in option_lists: |
|
1419 | for title, options in option_lists: | |
1411 |
opt_output.append(("\n%s |
|
1420 | opt_output.append(("\n%s" % title, None)) | |
1412 | for shortopt, longopt, default, desc in options: |
|
1421 | for shortopt, longopt, default, desc in options: | |
1413 | if "DEPRECATED" in desc and not ui.verbose: continue |
|
1422 | if "DEPRECATED" in desc and not ui.verbose: continue | |
1414 | opt_output.append(("%2s%s" % (shortopt and "-%s" % shortopt, |
|
1423 | opt_output.append(("%2s%s" % (shortopt and "-%s" % shortopt, | |
@@ -1419,7 +1428,7 b' def help_(ui, name=None, with_version=Fa' | |||||
1419 | or ""))) |
|
1428 | or ""))) | |
1420 |
|
1429 | |||
1421 | if opt_output: |
|
1430 | if opt_output: | |
1422 | opts_len = max([len(line[0]) for line in opt_output if line[1]]) |
|
1431 | opts_len = max([len(line[0]) for line in opt_output if line[1]] or [0]) | |
1423 | for first, second in opt_output: |
|
1432 | for first, second in opt_output: | |
1424 | if second: |
|
1433 | if second: | |
1425 | ui.write(" %-*s %s\n" % (opts_len, first, second)) |
|
1434 | ui.write(" %-*s %s\n" % (opts_len, first, second)) |
@@ -24,6 +24,8 b' options:' | |||||
24 | -r --rev revision |
|
24 | -r --rev revision | |
25 | -I --include include names matching the given patterns |
|
25 | -I --include include names matching the given patterns | |
26 | -X --exclude exclude names matching the given patterns |
|
26 | -X --exclude exclude names matching the given patterns | |
|
27 | ||||
|
28 | use "hg -v help falabala" to show global options | |||
27 | making snapshot of 1 files from rev e27a2475d60a |
|
29 | making snapshot of 1 files from rev e27a2475d60a | |
28 | making snapshot of 1 files from rev 5e49ec8d3f05 |
|
30 | making snapshot of 1 files from rev 5e49ec8d3f05 | |
29 | diffing a.e27a2475d60a a.5e49ec8d3f05 |
|
31 | diffing a.e27a2475d60a a.5e49ec8d3f05 |
@@ -117,7 +117,7 b' Mercurial Distributed SCM (version xxx)' | |||||
117 | %% -h/--help |
|
117 | %% -h/--help | |
118 | Mercurial Distributed SCM |
|
118 | Mercurial Distributed SCM | |
119 |
|
119 | |||
120 | list of commands (use "hg help -v" to show aliases and global options): |
|
120 | list of commands: | |
121 |
|
121 | |||
122 | add add the specified files on the next commit |
|
122 | add add the specified files on the next commit | |
123 | addremove add all new files, delete all missing files |
|
123 | addremove add all new files, delete all missing files | |
@@ -165,9 +165,11 b' list of commands (use "hg help -v" to sh' | |||||
165 | update update working directory |
|
165 | update update working directory | |
166 | verify verify the integrity of the repository |
|
166 | verify verify the integrity of the repository | |
167 | version output version and copyright information |
|
167 | version output version and copyright information | |
|
168 | ||||
|
169 | use "hg -v help" to show aliases and global options | |||
168 | Mercurial Distributed SCM |
|
170 | Mercurial Distributed SCM | |
169 |
|
171 | |||
170 | list of commands (use "hg help -v" to show aliases and global options): |
|
172 | list of commands: | |
171 |
|
173 | |||
172 | add add the specified files on the next commit |
|
174 | add add the specified files on the next commit | |
173 | addremove add all new files, delete all missing files |
|
175 | addremove add all new files, delete all missing files | |
@@ -215,4 +217,6 b' list of commands (use "hg help -v" to sh' | |||||
215 | update update working directory |
|
217 | update update working directory | |
216 | verify verify the integrity of the repository |
|
218 | verify verify the integrity of the repository | |
217 | version output version and copyright information |
|
219 | version output version and copyright information | |
|
220 | ||||
|
221 | use "hg -v help" to show aliases and global options | |||
218 | %% not tested: --debugger |
|
222 | %% not tested: --debugger |
@@ -1,6 +1,6 b'' | |||||
1 | Mercurial Distributed SCM |
|
1 | Mercurial Distributed SCM | |
2 |
|
2 | |||
3 | basic commands (use "hg help" for the full list or option "-v" for details): |
|
3 | basic commands: | |
4 |
|
4 | |||
5 | add add the specified files on the next commit |
|
5 | add add the specified files on the next commit | |
6 | annotate show changeset information per file line |
|
6 | annotate show changeset information per file line | |
@@ -19,6 +19,8 b' basic commands (use "hg help" for the fu' | |||||
19 | serve export the repository via HTTP |
|
19 | serve export the repository via HTTP | |
20 | status show changed files in the working directory |
|
20 | status show changed files in the working directory | |
21 | update update working directory |
|
21 | update update working directory | |
|
22 | ||||
|
23 | use "hg help" for the full list of commands or "hg -v" for details | |||
22 | add add the specified files on the next commit |
|
24 | add add the specified files on the next commit | |
23 | annotate show changeset information per file line |
|
25 | annotate show changeset information per file line | |
24 | clone make a copy of an existing repository |
|
26 | clone make a copy of an existing repository | |
@@ -38,7 +40,7 b' basic commands (use "hg help" for the fu' | |||||
38 | update update working directory |
|
40 | update update working directory | |
39 | Mercurial Distributed SCM |
|
41 | Mercurial Distributed SCM | |
40 |
|
42 | |||
41 | list of commands (use "hg help -v" to show aliases and global options): |
|
43 | list of commands: | |
42 |
|
44 | |||
43 | add add the specified files on the next commit |
|
45 | add add the specified files on the next commit | |
44 | addremove add all new files, delete all missing files |
|
46 | addremove add all new files, delete all missing files | |
@@ -86,6 +88,8 b' list of commands (use "hg help -v" to sh' | |||||
86 | update update working directory |
|
88 | update update working directory | |
87 | verify verify the integrity of the repository |
|
89 | verify verify the integrity of the repository | |
88 | version output version and copyright information |
|
90 | version output version and copyright information | |
|
91 | ||||
|
92 | use "hg -v help" to show aliases and global options | |||
89 | add add the specified files on the next commit |
|
93 | add add the specified files on the next commit | |
90 | addremove add all new files, delete all missing files |
|
94 | addremove add all new files, delete all missing files | |
91 | annotate show changeset information per file line |
|
95 | annotate show changeset information per file line | |
@@ -148,6 +152,8 b' options:' | |||||
148 | -I --include include names matching the given patterns |
|
152 | -I --include include names matching the given patterns | |
149 | -X --exclude exclude names matching the given patterns |
|
153 | -X --exclude exclude names matching the given patterns | |
150 | -n --dry-run do not perform actions, just print output |
|
154 | -n --dry-run do not perform actions, just print output | |
|
155 | ||||
|
156 | use "hg -v help add" to show global options | |||
151 | hg add: option --skjdfks not recognized |
|
157 | hg add: option --skjdfks not recognized | |
152 | hg add [OPTION]... [FILE]... |
|
158 | hg add [OPTION]... [FILE]... | |
153 |
|
159 | |||
@@ -165,6 +171,8 b' options:' | |||||
165 | -I --include include names matching the given patterns |
|
171 | -I --include include names matching the given patterns | |
166 | -X --exclude exclude names matching the given patterns |
|
172 | -X --exclude exclude names matching the given patterns | |
167 | -n --dry-run do not perform actions, just print output |
|
173 | -n --dry-run do not perform actions, just print output | |
|
174 | ||||
|
175 | use "hg -v help add" to show global options | |||
168 | hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]... |
|
176 | hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]... | |
169 |
|
177 | |||
170 | diff repository (or selected files) |
|
178 | diff repository (or selected files) | |
@@ -199,6 +207,8 b' options:' | |||||
199 | -B --ignore-blank-lines ignore changes whose lines are all blank |
|
207 | -B --ignore-blank-lines ignore changes whose lines are all blank | |
200 | -I --include include names matching the given patterns |
|
208 | -I --include include names matching the given patterns | |
201 | -X --exclude exclude names matching the given patterns |
|
209 | -X --exclude exclude names matching the given patterns | |
|
210 | ||||
|
211 | use "hg -v help diff" to show global options | |||
202 | hg status [OPTION]... [FILE]... |
|
212 | hg status [OPTION]... [FILE]... | |
203 |
|
213 | |||
204 | show changed files in the working directory |
|
214 | show changed files in the working directory | |
@@ -243,13 +253,15 b' options:' | |||||
243 | --rev show difference from revision |
|
253 | --rev show difference from revision | |
244 | -I --include include names matching the given patterns |
|
254 | -I --include include names matching the given patterns | |
245 | -X --exclude exclude names matching the given patterns |
|
255 | -X --exclude exclude names matching the given patterns | |
|
256 | ||||
|
257 | use "hg -v help status" to show global options | |||
246 | hg status [OPTION]... [FILE]... |
|
258 | hg status [OPTION]... [FILE]... | |
247 |
|
259 | |||
248 | show changed files in the working directory |
|
260 | show changed files in the working directory | |
249 | hg: unknown command 'foo' |
|
261 | hg: unknown command 'foo' | |
250 | Mercurial Distributed SCM |
|
262 | Mercurial Distributed SCM | |
251 |
|
263 | |||
252 | basic commands (use "hg help" for the full list or option "-v" for details): |
|
264 | basic commands: | |
253 |
|
265 | |||
254 | add add the specified files on the next commit |
|
266 | add add the specified files on the next commit | |
255 | annotate show changeset information per file line |
|
267 | annotate show changeset information per file line | |
@@ -268,10 +280,12 b' basic commands (use "hg help" for the fu' | |||||
268 | serve export the repository via HTTP |
|
280 | serve export the repository via HTTP | |
269 | status show changed files in the working directory |
|
281 | status show changed files in the working directory | |
270 | update update working directory |
|
282 | update update working directory | |
|
283 | ||||
|
284 | use "hg help" for the full list of commands or "hg -v" for details | |||
271 | hg: unknown command 'skjdfks' |
|
285 | hg: unknown command 'skjdfks' | |
272 | Mercurial Distributed SCM |
|
286 | Mercurial Distributed SCM | |
273 |
|
287 | |||
274 | basic commands (use "hg help" for the full list or option "-v" for details): |
|
288 | basic commands: | |
275 |
|
289 | |||
276 | add add the specified files on the next commit |
|
290 | add add the specified files on the next commit | |
277 | annotate show changeset information per file line |
|
291 | annotate show changeset information per file line | |
@@ -290,3 +304,5 b' basic commands (use "hg help" for the fu' | |||||
290 | serve export the repository via HTTP |
|
304 | serve export the repository via HTTP | |
291 | status show changed files in the working directory |
|
305 | status show changed files in the working directory | |
292 | update update working directory |
|
306 | update update working directory | |
|
307 | ||||
|
308 | use "hg help" for the full list of commands or "hg -v" for details |
@@ -22,7 +22,7 b' add known patch to applied stack ' | |||||
22 | remove patch from applied stack qpop |
|
22 | remove patch from applied stack qpop | |
23 | refresh contents of top applied patch qrefresh |
|
23 | refresh contents of top applied patch qrefresh | |
24 |
|
24 | |||
25 | list of commands (use "hg help -v mq" to show aliases and global options): |
|
25 | list of commands: | |
26 |
|
26 | |||
27 | qapplied print the patches already applied |
|
27 | qapplied print the patches already applied | |
28 | qclone clone main and patch repository at same time |
|
28 | qclone clone main and patch repository at same time | |
@@ -48,6 +48,8 b' list of commands (use "hg help -v mq" to' | |||||
48 | qtop print the name of the current patch |
|
48 | qtop print the name of the current patch | |
49 | qunapplied print the patches not yet applied |
|
49 | qunapplied print the patches not yet applied | |
50 | strip strip a revision and all later revs on the same branch |
|
50 | strip strip a revision and all later revs on the same branch | |
|
51 | ||||
|
52 | use "hg -v help mq" to show aliases and global options | |||
51 | adding a |
|
53 | adding a | |
52 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
54 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
53 | adding b/z |
|
55 | adding b/z |
@@ -3,7 +3,7 b' 0: a' | |||||
3 | hg: unknown command 'an' |
|
3 | hg: unknown command 'an' | |
4 | Mercurial Distributed SCM |
|
4 | Mercurial Distributed SCM | |
5 |
|
5 | |||
6 | basic commands (use "hg help" for the full list or option "-v" for details): |
|
6 | basic commands: | |
7 |
|
7 | |||
8 | add add the specified files on the next commit |
|
8 | add add the specified files on the next commit | |
9 | annotate show changeset information per file line |
|
9 | annotate show changeset information per file line | |
@@ -22,6 +22,8 b' basic commands (use "hg help" for the fu' | |||||
22 | serve export the repository via HTTP |
|
22 | serve export the repository via HTTP | |
23 | status show changed files in the working directory |
|
23 | status show changed files in the working directory | |
24 | update update working directory |
|
24 | update update working directory | |
|
25 | ||||
|
26 | use "hg help" for the full list of commands or "hg -v" for details | |||
25 | 0: a |
|
27 | 0: a | |
26 | % should succeed - up is an alias, not an abbreviation |
|
28 | % should succeed - up is an alias, not an abbreviation | |
27 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
29 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now