##// END OF EJS Templates
test-help: improve test coverage...
Henri Wiechers -
r10142:44fa0e20 default
parent child Browse files
Show More
@@ -1,51 +1,54 b''
1 1 #!/bin/sh
2 2
3 3 hg
4 4 hg -q
5 5 hg help
6 6 hg -q help
7 7
8 8 echo %% test short command list with verbose option
9 9 hg -v help shortlist | sed 's/[(]version [^)]*[)]/(version xxx)/'
10 10
11 11 hg add -h
12 12
13 13 echo %% test help option with version option
14 14 hg add -h --version | sed 's/[(]version [^)]*[)]/(version xxx)/'
15 15
16 16 hg add --skjdfks
17 17
18 18 echo %% test ambiguous command help
19 19 hg help ad
20 20
21 21 echo %% test command without options
22 22 hg help verify
23 23
24 24 hg help diff
25 25 hg help status
26 26 hg -q help status
27 27 hg help foo
28 28 hg skjdfks
29 29
30 30 cat > helpext.py <<EOF
31 31 import os
32 32 from mercurial import commands
33 33
34 34 def nohelp(ui, *args, **kwargs):
35 35 pass
36 36
37 37 cmdtable = {
38 38 "nohelp": (nohelp, [], "hg nohelp"),
39 39 }
40 40
41 41 commands.norepo += ' nohelp'
42 42 EOF
43 43 abspath=`pwd`/helpext.py
44 44
45 45 echo '[extensions]' >> $HGRCPATH
46 46 echo "helpext = $abspath" >> $HGRCPATH
47 47
48 48 echo %% test command with no help text
49 49 hg help nohelp
50 50
51 echo %% test that default list of commands omits extension commands
52 hg help
53
51 54 exit 0
@@ -1,470 +1,544 b''
1 1 Mercurial Distributed SCM
2 2
3 3 basic commands:
4 4
5 5 add add the specified files on the next commit
6 6 annotate show changeset information by line for each file
7 7 clone make a copy of an existing repository
8 8 commit commit the specified files or all outstanding changes
9 9 diff diff repository (or selected files)
10 10 export dump the header and diffs for one or more changesets
11 11 forget forget the specified files on the next commit
12 12 init create a new repository in the given directory
13 13 log show revision history of entire repository or files
14 14 merge merge working directory with another revision
15 15 pull pull changes from the specified source
16 16 push push changes to the specified destination
17 17 remove remove the specified files on the next commit
18 18 serve export the repository via HTTP
19 19 status show changed files in the working directory
20 20 summary summarize working directory state
21 21 update update working directory
22 22
23 23 use "hg help" for the full list of commands or "hg -v" for details
24 24 add add the specified files on the next commit
25 25 annotate show changeset information by line for each file
26 26 clone make a copy of an existing repository
27 27 commit commit the specified files or all outstanding changes
28 28 diff diff repository (or selected files)
29 29 export dump the header and diffs for one or more changesets
30 30 forget forget the specified files on the next commit
31 31 init create a new repository in the given directory
32 32 log show revision history of entire repository or files
33 33 merge merge working directory with another revision
34 34 pull pull changes from the specified source
35 35 push push changes to the specified destination
36 36 remove remove the specified files on the next commit
37 37 serve export the repository via HTTP
38 38 status show changed files in the working directory
39 39 summary summarize working directory state
40 40 update update working directory
41 41 Mercurial Distributed SCM
42 42
43 43 list of commands:
44 44
45 45 add add the specified files on the next commit
46 46 addremove add all new files, delete all missing files
47 47 annotate show changeset information by line for each file
48 48 archive create an unversioned archive of a repository revision
49 49 backout reverse effect of earlier changeset
50 50 bisect subdivision search of changesets
51 51 branch set or show the current branch name
52 52 branches list repository named branches
53 53 bundle create a changegroup file
54 54 cat output the current or given revision of files
55 55 clone make a copy of an existing repository
56 56 commit commit the specified files or all outstanding changes
57 57 copy mark files as copied for the next commit
58 58 diff diff repository (or selected files)
59 59 export dump the header and diffs for one or more changesets
60 60 forget forget the specified files on the next commit
61 61 grep search for a pattern in specified files and revisions
62 62 heads show current repository heads or show branch heads
63 63 help show help for a given topic or a help overview
64 64 identify identify the working copy or specified revision
65 65 import import an ordered set of patches
66 66 incoming show new changesets found in source
67 67 init create a new repository in the given directory
68 68 locate locate files matching specific patterns
69 69 log show revision history of entire repository or files
70 70 manifest output the current or given revision of the project manifest
71 71 merge merge working directory with another revision
72 72 outgoing show changesets not found in destination
73 73 parents show the parents of the working directory or revision
74 74 paths show aliases for remote repositories
75 75 pull pull changes from the specified source
76 76 push push changes to the specified destination
77 77 recover roll back an interrupted transaction
78 78 remove remove the specified files on the next commit
79 79 rename rename files; equivalent of copy + remove
80 80 resolve retry file merges from a merge or update
81 81 revert restore individual files or directories to an earlier state
82 82 rollback roll back the last transaction
83 83 root print the root (top) of the current working directory
84 84 serve export the repository via HTTP
85 85 showconfig show combined config settings from all hgrc files
86 86 status show changed files in the working directory
87 87 summary summarize working directory state
88 88 tag add one or more tags for the current or given revision
89 89 tags list repository tags
90 90 tip show the tip revision
91 91 unbundle apply one or more changegroup files
92 92 update update working directory
93 93 verify verify the integrity of the repository
94 94 version output version and copyright information
95 95
96 96 additional help topics:
97 97
98 98 config Configuration Files
99 99 dates Date Formats
100 100 patterns File Name Patterns
101 101 environment Environment Variables
102 102 revisions Specifying Single Revisions
103 103 multirevs Specifying Multiple Revisions
104 104 diffs Diff Formats
105 105 templating Template Usage
106 106 urls URL Paths
107 107 extensions Using additional features
108 108
109 109 use "hg -v help" to show aliases and global options
110 110 add add the specified files on the next commit
111 111 addremove add all new files, delete all missing files
112 112 annotate show changeset information by line for each file
113 113 archive create an unversioned archive of a repository revision
114 114 backout reverse effect of earlier changeset
115 115 bisect subdivision search of changesets
116 116 branch set or show the current branch name
117 117 branches list repository named branches
118 118 bundle create a changegroup file
119 119 cat output the current or given revision of files
120 120 clone make a copy of an existing repository
121 121 commit commit the specified files or all outstanding changes
122 122 copy mark files as copied for the next commit
123 123 diff diff repository (or selected files)
124 124 export dump the header and diffs for one or more changesets
125 125 forget forget the specified files on the next commit
126 126 grep search for a pattern in specified files and revisions
127 127 heads show current repository heads or show branch heads
128 128 help show help for a given topic or a help overview
129 129 identify identify the working copy or specified revision
130 130 import import an ordered set of patches
131 131 incoming show new changesets found in source
132 132 init create a new repository in the given directory
133 133 locate locate files matching specific patterns
134 134 log show revision history of entire repository or files
135 135 manifest output the current or given revision of the project manifest
136 136 merge merge working directory with another revision
137 137 outgoing show changesets not found in destination
138 138 parents show the parents of the working directory or revision
139 139 paths show aliases for remote repositories
140 140 pull pull changes from the specified source
141 141 push push changes to the specified destination
142 142 recover roll back an interrupted transaction
143 143 remove remove the specified files on the next commit
144 144 rename rename files; equivalent of copy + remove
145 145 resolve retry file merges from a merge or update
146 146 revert restore individual files or directories to an earlier state
147 147 rollback roll back the last transaction
148 148 root print the root (top) of the current working directory
149 149 serve export the repository via HTTP
150 150 showconfig show combined config settings from all hgrc files
151 151 status show changed files in the working directory
152 152 summary summarize working directory state
153 153 tag add one or more tags for the current or given revision
154 154 tags list repository tags
155 155 tip show the tip revision
156 156 unbundle apply one or more changegroup files
157 157 update update working directory
158 158 verify verify the integrity of the repository
159 159 version output version and copyright information
160 160
161 161 additional help topics:
162 162
163 163 config Configuration Files
164 164 dates Date Formats
165 165 patterns File Name Patterns
166 166 environment Environment Variables
167 167 revisions Specifying Single Revisions
168 168 multirevs Specifying Multiple Revisions
169 169 diffs Diff Formats
170 170 templating Template Usage
171 171 urls URL Paths
172 172 extensions Using additional features
173 173 %% test short command list with verbose option
174 174 Mercurial Distributed SCM (version xxx)
175 175
176 176 Copyright (C) 2005-2009 Matt Mackall <mpm@selenic.com> and others
177 177 This is free software; see the source for copying conditions. There is NO
178 178 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
179 179
180 180 basic commands:
181 181
182 182 add:
183 183 add the specified files on the next commit
184 184 annotate, blame:
185 185 show changeset information by line for each file
186 186 clone:
187 187 make a copy of an existing repository
188 188 commit, ci:
189 189 commit the specified files or all outstanding changes
190 190 diff:
191 191 diff repository (or selected files)
192 192 export:
193 193 dump the header and diffs for one or more changesets
194 194 forget:
195 195 forget the specified files on the next commit
196 196 init:
197 197 create a new repository in the given directory
198 198 log, history:
199 199 show revision history of entire repository or files
200 200 merge:
201 201 merge working directory with another revision
202 202 pull:
203 203 pull changes from the specified source
204 204 push:
205 205 push changes to the specified destination
206 206 remove, rm:
207 207 remove the specified files on the next commit
208 208 serve:
209 209 export the repository via HTTP
210 210 status, st:
211 211 show changed files in the working directory
212 212 summary, sum:
213 213 summarize working directory state
214 214 update, up, checkout, co:
215 215 update working directory
216 216
217 217 global options:
218 218 -R --repository repository root directory or name of overlay bundle file
219 219 --cwd change working directory
220 220 -y --noninteractive do not prompt, assume 'yes' for any required answers
221 221 -q --quiet suppress output
222 222 -v --verbose enable additional output
223 223 --config set/override config option
224 224 --debug enable debugging output
225 225 --debugger start debugger
226 226 --encoding set the charset encoding (default: ascii)
227 227 --encodingmode set the charset encoding mode (default: strict)
228 228 --traceback always print a traceback on exception
229 229 --time time how long the command takes
230 230 --profile print command execution profile
231 231 --version output version information and exit
232 232 -h --help display help and exit
233 233
234 234 use "hg help" for the full list of commands
235 235 hg add [OPTION]... [FILE]...
236 236
237 237 add the specified files on the next commit
238 238
239 239 Schedule files to be version controlled and added to the repository.
240 240
241 241 The files will be added to the repository at the next commit. To undo an
242 242 add before that, see hg forget.
243 243
244 244 If no names are given, add all files to the repository.
245 245
246 246 options:
247 247
248 248 -I --include include names matching the given patterns
249 249 -X --exclude exclude names matching the given patterns
250 250 -n --dry-run do not perform actions, just print output
251 251
252 252 use "hg -v help add" to show global options
253 253 %% test help option with version option
254 254 Mercurial Distributed SCM (version xxx)
255 255
256 256 Copyright (C) 2005-2009 Matt Mackall <mpm@selenic.com> and others
257 257 This is free software; see the source for copying conditions. There is NO
258 258 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
259 259
260 260 hg add [OPTION]... [FILE]...
261 261
262 262 add the specified files on the next commit
263 263
264 264 Schedule files to be version controlled and added to the repository.
265 265
266 266 The files will be added to the repository at the next commit. To undo an
267 267 add before that, see hg forget.
268 268
269 269 If no names are given, add all files to the repository.
270 270
271 271 options:
272 272
273 273 -I --include include names matching the given patterns
274 274 -X --exclude exclude names matching the given patterns
275 275 -n --dry-run do not perform actions, just print output
276 276
277 277 use "hg -v help add" to show global options
278 278 hg add: option --skjdfks not recognized
279 279 hg add [OPTION]... [FILE]...
280 280
281 281 add the specified files on the next commit
282 282
283 283 Schedule files to be version controlled and added to the repository.
284 284
285 285 The files will be added to the repository at the next commit. To undo an
286 286 add before that, see hg forget.
287 287
288 288 If no names are given, add all files to the repository.
289 289
290 290 options:
291 291
292 292 -I --include include names matching the given patterns
293 293 -X --exclude exclude names matching the given patterns
294 294 -n --dry-run do not perform actions, just print output
295 295
296 296 use "hg -v help add" to show global options
297 297 %% test ambiguous command help
298 298 list of commands:
299 299
300 300 add add the specified files on the next commit
301 301 addremove add all new files, delete all missing files
302 302
303 303 use "hg -v help ad" to show aliases and global options
304 304 %% test command without options
305 305 hg verify
306 306
307 307 verify the integrity of the repository
308 308
309 309 Verify the integrity of the current repository.
310 310
311 311 This will perform an extensive check of the repository's integrity,
312 312 validating the hashes and checksums of each entry in the changelog,
313 313 manifest, and tracked files, as well as the integrity of their crosslinks
314 314 and indices.
315 315
316 316 use "hg -v help verify" to show global options
317 317 hg diff [OPTION]... [-r REV1 [-r REV2]] [FILE]...
318 318
319 319 diff repository (or selected files)
320 320
321 321 Show differences between revisions for the specified files.
322 322
323 323 Differences between files are shown using the unified diff format.
324 324
325 325 NOTE: diff may generate unexpected results for merges, as it will default
326 326 to comparing against the working directory's first parent changeset if no
327 327 revisions are specified.
328 328
329 329 When two revision arguments are given, then changes are shown between
330 330 those revisions. If only one revision is specified then that revision is
331 331 compared to the working directory, and, when no revisions are specified,
332 332 the working directory files are compared to its parent.
333 333
334 334 Without the -a/--text option, diff will avoid generating diffs of files it
335 335 detects as binary. With -a, diff will generate a diff anyway, probably
336 336 with undesirable results.
337 337
338 338 Use the -g/--git option to generate diffs in the git extended diff format.
339 339 For more information, read 'hg help diffs'.
340 340
341 341 options:
342 342
343 343 -r --rev revision
344 344 -c --change change made by revision
345 345 -a --text treat all files as text
346 346 -g --git use git extended diff format
347 347 --nodates don't include dates in diff headers
348 348 -p --show-function show which function each change is in
349 349 --reverse produce a diff that undoes the changes
350 350 -w --ignore-all-space ignore white space when comparing lines
351 351 -b --ignore-space-change ignore changes in the amount of white space
352 352 -B --ignore-blank-lines ignore changes whose lines are all blank
353 353 -U --unified number of lines of context to show
354 354 --stat output diffstat-style summary of changes
355 355 -I --include include names matching the given patterns
356 356 -X --exclude exclude names matching the given patterns
357 357
358 358 use "hg -v help diff" to show global options
359 359 hg status [OPTION]... [FILE]...
360 360
361 361 aliases: st
362 362
363 363 show changed files in the working directory
364 364
365 365 Show status of files in the repository. If names are given, only files
366 366 that match are shown. Files that are clean or ignored or the source of a
367 367 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
368 368 -C/--copies or -A/--all are given. Unless options described with "show
369 369 only ..." are given, the options -mardu are used.
370 370
371 371 Option -q/--quiet hides untracked (unknown and ignored) files unless
372 372 explicitly requested with -u/--unknown or -i/--ignored.
373 373
374 374 NOTE: status may appear to disagree with diff if permissions have changed
375 375 or a merge has occurred. The standard diff format does not report
376 376 permission changes and diff only reports changes relative to one merge
377 377 parent.
378 378
379 379 If one revision is given, it is used as the base revision. If two
380 380 revisions are given, the differences between them are shown. The --change
381 381 option can also be used as a shortcut to list the changed files of a
382 382 revision from its first parent.
383 383
384 384 The codes used to show the status of files are:
385 385
386 386 M = modified
387 387 A = added
388 388 R = removed
389 389 C = clean
390 390 ! = missing (deleted by non-hg command, but still tracked)
391 391 ? = not tracked
392 392 I = ignored
393 393 = origin of the previous file listed as A (added)
394 394
395 395 options:
396 396
397 397 -A --all show status of all files
398 398 -m --modified show only modified files
399 399 -a --added show only added files
400 400 -r --removed show only removed files
401 401 -d --deleted show only deleted (but tracked) files
402 402 -c --clean show only files without changes
403 403 -u --unknown show only unknown (not tracked) files
404 404 -i --ignored show only ignored files
405 405 -n --no-status hide status prefix
406 406 -C --copies show source of copied files
407 407 -0 --print0 end filenames with NUL, for use with xargs
408 408 --rev show difference from revision
409 409 --change list the changed files of a revision
410 410 -I --include include names matching the given patterns
411 411 -X --exclude exclude names matching the given patterns
412 412
413 413 use "hg -v help status" to show global options
414 414 hg status [OPTION]... [FILE]...
415 415
416 416 show changed files in the working directory
417 417 hg: unknown command 'foo'
418 418 Mercurial Distributed SCM
419 419
420 420 basic commands:
421 421
422 422 add add the specified files on the next commit
423 423 annotate show changeset information by line for each file
424 424 clone make a copy of an existing repository
425 425 commit commit the specified files or all outstanding changes
426 426 diff diff repository (or selected files)
427 427 export dump the header and diffs for one or more changesets
428 428 forget forget the specified files on the next commit
429 429 init create a new repository in the given directory
430 430 log show revision history of entire repository or files
431 431 merge merge working directory with another revision
432 432 pull pull changes from the specified source
433 433 push push changes to the specified destination
434 434 remove remove the specified files on the next commit
435 435 serve export the repository via HTTP
436 436 status show changed files in the working directory
437 437 summary summarize working directory state
438 438 update update working directory
439 439
440 440 use "hg help" for the full list of commands or "hg -v" for details
441 441 hg: unknown command 'skjdfks'
442 442 Mercurial Distributed SCM
443 443
444 444 basic commands:
445 445
446 446 add add the specified files on the next commit
447 447 annotate show changeset information by line for each file
448 448 clone make a copy of an existing repository
449 449 commit commit the specified files or all outstanding changes
450 450 diff diff repository (or selected files)
451 451 export dump the header and diffs for one or more changesets
452 452 forget forget the specified files on the next commit
453 453 init create a new repository in the given directory
454 454 log show revision history of entire repository or files
455 455 merge merge working directory with another revision
456 456 pull pull changes from the specified source
457 457 push push changes to the specified destination
458 458 remove remove the specified files on the next commit
459 459 serve export the repository via HTTP
460 460 status show changed files in the working directory
461 461 summary summarize working directory state
462 462 update update working directory
463 463
464 464 use "hg help" for the full list of commands or "hg -v" for details
465 465 %% test command with no help text
466 466 hg nohelp
467 467
468 468 (no help text available)
469 469
470 470 use "hg -v help nohelp" to show global options
471 %% test that default list of commands omits extension commands
472 Mercurial Distributed SCM
473
474 list of commands:
475
476 add add the specified files on the next commit
477 addremove add all new files, delete all missing files
478 annotate show changeset information by line for each file
479 archive create an unversioned archive of a repository revision
480 backout reverse effect of earlier changeset
481 bisect subdivision search of changesets
482 branch set or show the current branch name
483 branches list repository named branches
484 bundle create a changegroup file
485 cat output the current or given revision of files
486 clone make a copy of an existing repository
487 commit commit the specified files or all outstanding changes
488 copy mark files as copied for the next commit
489 diff diff repository (or selected files)
490 export dump the header and diffs for one or more changesets
491 forget forget the specified files on the next commit
492 grep search for a pattern in specified files and revisions
493 heads show current repository heads or show branch heads
494 help show help for a given topic or a help overview
495 identify identify the working copy or specified revision
496 import import an ordered set of patches
497 incoming show new changesets found in source
498 init create a new repository in the given directory
499 locate locate files matching specific patterns
500 log show revision history of entire repository or files
501 manifest output the current or given revision of the project manifest
502 merge merge working directory with another revision
503 outgoing show changesets not found in destination
504 parents show the parents of the working directory or revision
505 paths show aliases for remote repositories
506 pull pull changes from the specified source
507 push push changes to the specified destination
508 recover roll back an interrupted transaction
509 remove remove the specified files on the next commit
510 rename rename files; equivalent of copy + remove
511 resolve retry file merges from a merge or update
512 revert restore individual files or directories to an earlier state
513 rollback roll back the last transaction
514 root print the root (top) of the current working directory
515 serve export the repository via HTTP
516 showconfig show combined config settings from all hgrc files
517 status show changed files in the working directory
518 summary summarize working directory state
519 tag add one or more tags for the current or given revision
520 tags list repository tags
521 tip show the tip revision
522 unbundle apply one or more changegroup files
523 update update working directory
524 verify verify the integrity of the repository
525 version output version and copyright information
526
527 enabled extensions:
528
529 helpext (no help text available)
530
531 additional help topics:
532
533 config Configuration Files
534 dates Date Formats
535 patterns File Name Patterns
536 environment Environment Variables
537 revisions Specifying Single Revisions
538 multirevs Specifying Multiple Revisions
539 diffs Diff Formats
540 templating Template Usage
541 urls URL Paths
542 extensions Using additional features
543
544 use "hg -v help" to show aliases and global options
General Comments 0
You need to be logged in to leave comments. Login now