comparison tests/test-help.t @ 30152:d65e246100ed

help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 09 Oct 2016 03:11:18 +0200
parents cd7276f7ea83
children ff7df4bb75de
comparison
equal deleted inserted replaced
30151:381293e1135e 30152:d65e246100ed
316 -R --repository REPO repository root directory or name of overlay bundle 316 -R --repository REPO repository root directory or name of overlay bundle
317 file 317 file
318 --cwd DIR change working directory 318 --cwd DIR change working directory
319 -y --noninteractive do not prompt, automatically pick the first choice for 319 -y --noninteractive do not prompt, automatically pick the first choice for
320 all prompts 320 all prompts
321 -q --[no-]quiet suppress output 321 -q --quiet suppress output
322 -v --[no-]verbose enable additional output 322 -v --verbose enable additional output
323 --config CONFIG [+] set/override config option (use 'section.name=value') 323 --config CONFIG [+] set/override config option (use 'section.name=value')
324 --[no-]debug enable debugging output 324 --debug enable debugging output
325 --[no-]debugger start debugger 325 --debugger start debugger
326 --encoding ENCODE set the charset encoding (default: ascii) 326 --encoding ENCODE set the charset encoding (default: ascii)
327 --encodingmode MODE set the charset encoding mode (default: strict) 327 --encodingmode MODE set the charset encoding mode (default: strict)
328 --[no-]traceback always print a traceback on exception 328 --traceback always print a traceback on exception
329 --[no-]time time how long the command takes 329 --time time how long the command takes
330 --[no-]profile print command execution profile 330 --profile print command execution profile
331 --version output version information and exit 331 --version output version information and exit
332 -h --help display help and exit 332 -h --help display help and exit
333 --[no-]hidden consider hidden changesets 333 --hidden consider hidden changesets
334 334
335 (use 'hg help' for the full list of commands) 335 (use 'hg help' for the full list of commands)
336 336
337 $ hg add -h 337 $ hg add -h
338 hg add [OPTION]... [FILE]... 338 hg add [OPTION]... [FILE]...
351 351
352 options ([+] can be repeated): 352 options ([+] can be repeated):
353 353
354 -I --include PATTERN [+] include names matching the given patterns 354 -I --include PATTERN [+] include names matching the given patterns
355 -X --exclude PATTERN [+] exclude names matching the given patterns 355 -X --exclude PATTERN [+] exclude names matching the given patterns
356 -S --[no-]subrepos recurse into subrepositories 356 -S --subrepos recurse into subrepositories
357 -n --[no-]dry-run do not perform actions, just print output 357 -n --dry-run do not perform actions, just print output
358 358
359 (some details hidden, use --verbose to show complete help) 359 (some details hidden, use --verbose to show complete help)
360 360
361 Verbose help for add 361 Verbose help for add
362 362
402 402
403 options ([+] can be repeated): 403 options ([+] can be repeated):
404 404
405 -I --include PATTERN [+] include names matching the given patterns 405 -I --include PATTERN [+] include names matching the given patterns
406 -X --exclude PATTERN [+] exclude names matching the given patterns 406 -X --exclude PATTERN [+] exclude names matching the given patterns
407 -S --[no-]subrepos recurse into subrepositories 407 -S --subrepos recurse into subrepositories
408 -n --[no-]dry-run do not perform actions, just print output 408 -n --dry-run do not perform actions, just print output
409 409
410 global options ([+] can be repeated): 410 global options ([+] can be repeated):
411 411
412 -R --repository REPO repository root directory or name of overlay bundle 412 -R --repository REPO repository root directory or name of overlay bundle
413 file 413 file
414 --cwd DIR change working directory 414 --cwd DIR change working directory
415 -y --noninteractive do not prompt, automatically pick the first choice for 415 -y --noninteractive do not prompt, automatically pick the first choice for
416 all prompts 416 all prompts
417 -q --[no-]quiet suppress output 417 -q --quiet suppress output
418 -v --[no-]verbose enable additional output 418 -v --verbose enable additional output
419 --config CONFIG [+] set/override config option (use 'section.name=value') 419 --config CONFIG [+] set/override config option (use 'section.name=value')
420 --[no-]debug enable debugging output 420 --debug enable debugging output
421 --[no-]debugger start debugger 421 --debugger start debugger
422 --encoding ENCODE set the charset encoding (default: ascii) 422 --encoding ENCODE set the charset encoding (default: ascii)
423 --encodingmode MODE set the charset encoding mode (default: strict) 423 --encodingmode MODE set the charset encoding mode (default: strict)
424 --[no-]traceback always print a traceback on exception 424 --traceback always print a traceback on exception
425 --[no-]time time how long the command takes 425 --time time how long the command takes
426 --[no-]profile print command execution profile 426 --profile print command execution profile
427 --version output version information and exit 427 --version output version information and exit
428 -h --help display help and exit 428 -h --help display help and exit
429 --[no-]hidden consider hidden changesets 429 --hidden consider hidden changesets
430 430
431 Test the textwidth config option 431 Test the textwidth config option
432 432
433 $ hg root -h --config ui.textwidth=50 433 $ hg root -h --config ui.textwidth=50
434 hg root 434 hg root
462 462
463 options ([+] can be repeated): 463 options ([+] can be repeated):
464 464
465 -I --include PATTERN [+] include names matching the given patterns 465 -I --include PATTERN [+] include names matching the given patterns
466 -X --exclude PATTERN [+] exclude names matching the given patterns 466 -X --exclude PATTERN [+] exclude names matching the given patterns
467 -S --[no-]subrepos recurse into subrepositories 467 -S --subrepos recurse into subrepositories
468 -n --[no-]dry-run do not perform actions, just print output 468 -n --dry-run do not perform actions, just print output
469 469
470 (use 'hg add -h' to show more help) 470 (use 'hg add -h' to show more help)
471 [255] 471 [255]
472 472
473 Test ambiguous command help 473 Test ambiguous command help
532 532
533 Returns 0 on success. 533 Returns 0 on success.
534 534
535 options ([+] can be repeated): 535 options ([+] can be repeated):
536 536
537 -r --rev REV [+] revision 537 -r --rev REV [+] revision
538 -c --change REV change made by revision 538 -c --change REV change made by revision
539 -a --[no-]text treat all files as text 539 -a --text treat all files as text
540 -g --[no-]git use git extended diff format 540 -g --git use git extended diff format
541 --[no-]nodates omit dates from diff headers 541 --nodates omit dates from diff headers
542 --[no-]noprefix omit a/ and b/ prefixes from filenames 542 --noprefix omit a/ and b/ prefixes from filenames
543 -p --[no-]show-function show which function each change is in 543 -p --show-function show which function each change is in
544 --[no-]reverse produce a diff that undoes the changes 544 --reverse produce a diff that undoes the changes
545 -w --[no-]ignore-all-space ignore white space when comparing lines 545 -w --ignore-all-space ignore white space when comparing lines
546 -b --[no-]ignore-space-change ignore changes in the amount of white space 546 -b --ignore-space-change ignore changes in the amount of white space
547 -B --[no-]ignore-blank-lines ignore changes whose lines are all blank 547 -B --ignore-blank-lines ignore changes whose lines are all blank
548 -U --unified NUM number of lines of context to show 548 -U --unified NUM number of lines of context to show
549 --[no-]stat output diffstat-style summary of changes 549 --stat output diffstat-style summary of changes
550 --root DIR produce diffs relative to subdirectory 550 --root DIR produce diffs relative to subdirectory
551 -I --include PATTERN [+] include names matching the given patterns 551 -I --include PATTERN [+] include names matching the given patterns
552 -X --exclude PATTERN [+] exclude names matching the given patterns 552 -X --exclude PATTERN [+] exclude names matching the given patterns
553 -S --[no-]subrepos recurse into subrepositories 553 -S --subrepos recurse into subrepositories
554 554
555 (some details hidden, use --verbose to show complete help) 555 (some details hidden, use --verbose to show complete help)
556 556
557 $ hg help status 557 $ hg help status
558 hg status [OPTION]... [FILE]... 558 hg status [OPTION]... [FILE]...
594 594
595 Returns 0 on success. 595 Returns 0 on success.
596 596
597 options ([+] can be repeated): 597 options ([+] can be repeated):
598 598
599 -A --[no-]all show status of all files 599 -A --all show status of all files
600 -m --[no-]modified show only modified files 600 -m --modified show only modified files
601 -a --[no-]added show only added files 601 -a --added show only added files
602 -r --[no-]removed show only removed files 602 -r --removed show only removed files
603 -d --[no-]deleted show only deleted (but tracked) files 603 -d --deleted show only deleted (but tracked) files
604 -c --[no-]clean show only files without changes 604 -c --clean show only files without changes
605 -u --[no-]unknown show only unknown (not tracked) files 605 -u --unknown show only unknown (not tracked) files
606 -i --[no-]ignored show only ignored files 606 -i --ignored show only ignored files
607 -n --[no-]status hide status prefix 607 -n --no-status hide status prefix
608 -C --[no-]copies show source of copied files 608 -C --copies show source of copied files
609 -0 --[no-]print0 end filenames with NUL, for use with xargs 609 -0 --print0 end filenames with NUL, for use with xargs
610 --rev REV [+] show difference from revision 610 --rev REV [+] show difference from revision
611 --change REV list the changed files of a revision 611 --change REV list the changed files of a revision
612 -I --include PATTERN [+] include names matching the given patterns 612 -I --include PATTERN [+] include names matching the given patterns
613 -X --exclude PATTERN [+] exclude names matching the given patterns 613 -X --exclude PATTERN [+] exclude names matching the given patterns
614 -S --[no-]subrepos recurse into subrepositories 614 -S --subrepos recurse into subrepositories
615 615
616 (some details hidden, use --verbose to show complete help) 616 (some details hidden, use --verbose to show complete help)
617 617
618 $ hg -q help status 618 $ hg -q help status
619 hg status [OPTION]... [FILE]... 619 hg status [OPTION]... [FILE]...
715 715
716 defined by: helpext 716 defined by: helpext
717 717
718 options: 718 options:
719 719
720 --[no-]remote check for push and pull 720 --remote check for push and pull
721 721
722 (some details hidden, use --verbose to show complete help) 722 (some details hidden, use --verbose to show complete help)
723 723
724 $ hg help shellalias 724 $ hg help shellalias
725 hg shellalias 725 hg shellalias
741 741
742 options: 742 options:
743 743
744 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 744 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
745 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3) 745 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
746 -n --[no-] normal desc 746 -n -- normal desc
747 --newline VALUE line1 line2 747 --newline VALUE line1 line2
748 748
749 (some details hidden, use --verbose to show complete help) 749 (some details hidden, use --verbose to show complete help)
750 750
751 $ hg help -k nohelp 751 $ hg help -k nohelp
1126 1126
1127 (some details hidden, use --verbose to show complete help) 1127 (some details hidden, use --verbose to show complete help)
1128 1128
1129 test deprecated and experimental options is shown with -v 1129 test deprecated and experimental options is shown with -v
1130 $ hg help -v debugoptDEP | grep dopt 1130 $ hg help -v debugoptDEP | grep dopt
1131 --[no-]dopt option is (DEPRECATED) 1131 --dopt option is (DEPRECATED)
1132 $ hg help -v debugoptEXP | grep eopt 1132 $ hg help -v debugoptEXP | grep eopt
1133 --[no-]eopt option is (EXPERIMENTAL) 1133 --eopt option is (EXPERIMENTAL)
1134 1134
1135 #if gettext 1135 #if gettext
1136 test deprecated option is hidden with translation with untranslated description 1136 test deprecated option is hidden with translation with untranslated description
1137 (use many globy for not failing on changed transaction) 1137 (use many globy for not failing on changed transaction)
1138 $ LANGUAGE=sv hg help debugoptDEP 1138 $ LANGUAGE=sv hg help debugoptDEP
2472 <td>include names matching the given patterns</td></tr> 2472 <td>include names matching the given patterns</td></tr>
2473 <tr><td>-X</td> 2473 <tr><td>-X</td>
2474 <td>--exclude PATTERN [+]</td> 2474 <td>--exclude PATTERN [+]</td>
2475 <td>exclude names matching the given patterns</td></tr> 2475 <td>exclude names matching the given patterns</td></tr>
2476 <tr><td>-S</td> 2476 <tr><td>-S</td>
2477 <td>--[no-]subrepos</td> 2477 <td>--subrepos</td>
2478 <td>recurse into subrepositories</td></tr> 2478 <td>recurse into subrepositories</td></tr>
2479 <tr><td>-n</td> 2479 <tr><td>-n</td>
2480 <td>--[no-]dry-run</td> 2480 <td>--dry-run</td>
2481 <td>do not perform actions, just print output</td></tr> 2481 <td>do not perform actions, just print output</td></tr>
2482 </table> 2482 </table>
2483 <p> 2483 <p>
2484 global options ([+] can be repeated): 2484 global options ([+] can be repeated):
2485 </p> 2485 </p>
2492 <td>change working directory</td></tr> 2492 <td>change working directory</td></tr>
2493 <tr><td>-y</td> 2493 <tr><td>-y</td>
2494 <td>--noninteractive</td> 2494 <td>--noninteractive</td>
2495 <td>do not prompt, automatically pick the first choice for all prompts</td></tr> 2495 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2496 <tr><td>-q</td> 2496 <tr><td>-q</td>
2497 <td>--[no-]quiet</td> 2497 <td>--quiet</td>
2498 <td>suppress output</td></tr> 2498 <td>suppress output</td></tr>
2499 <tr><td>-v</td> 2499 <tr><td>-v</td>
2500 <td>--[no-]verbose</td> 2500 <td>--verbose</td>
2501 <td>enable additional output</td></tr> 2501 <td>enable additional output</td></tr>
2502 <tr><td></td> 2502 <tr><td></td>
2503 <td>--config CONFIG [+]</td> 2503 <td>--config CONFIG [+]</td>
2504 <td>set/override config option (use 'section.name=value')</td></tr> 2504 <td>set/override config option (use 'section.name=value')</td></tr>
2505 <tr><td></td> 2505 <tr><td></td>
2506 <td>--[no-]debug</td> 2506 <td>--debug</td>
2507 <td>enable debugging output</td></tr> 2507 <td>enable debugging output</td></tr>
2508 <tr><td></td> 2508 <tr><td></td>
2509 <td>--[no-]debugger</td> 2509 <td>--debugger</td>
2510 <td>start debugger</td></tr> 2510 <td>start debugger</td></tr>
2511 <tr><td></td> 2511 <tr><td></td>
2512 <td>--encoding ENCODE</td> 2512 <td>--encoding ENCODE</td>
2513 <td>set the charset encoding (default: ascii)</td></tr> 2513 <td>set the charset encoding (default: ascii)</td></tr>
2514 <tr><td></td> 2514 <tr><td></td>
2515 <td>--encodingmode MODE</td> 2515 <td>--encodingmode MODE</td>
2516 <td>set the charset encoding mode (default: strict)</td></tr> 2516 <td>set the charset encoding mode (default: strict)</td></tr>
2517 <tr><td></td> 2517 <tr><td></td>
2518 <td>--[no-]traceback</td> 2518 <td>--traceback</td>
2519 <td>always print a traceback on exception</td></tr> 2519 <td>always print a traceback on exception</td></tr>
2520 <tr><td></td> 2520 <tr><td></td>
2521 <td>--[no-]time</td> 2521 <td>--time</td>
2522 <td>time how long the command takes</td></tr> 2522 <td>time how long the command takes</td></tr>
2523 <tr><td></td> 2523 <tr><td></td>
2524 <td>--[no-]profile</td> 2524 <td>--profile</td>
2525 <td>print command execution profile</td></tr> 2525 <td>print command execution profile</td></tr>
2526 <tr><td></td> 2526 <tr><td></td>
2527 <td>--version</td> 2527 <td>--version</td>
2528 <td>output version information and exit</td></tr> 2528 <td>output version information and exit</td></tr>
2529 <tr><td>-h</td> 2529 <tr><td>-h</td>
2530 <td>--help</td> 2530 <td>--help</td>
2531 <td>display help and exit</td></tr> 2531 <td>display help and exit</td></tr>
2532 <tr><td></td> 2532 <tr><td></td>
2533 <td>--[no-]hidden</td> 2533 <td>--hidden</td>
2534 <td>consider hidden changesets</td></tr> 2534 <td>consider hidden changesets</td></tr>
2535 </table> 2535 </table>
2536 2536
2537 </div> 2537 </div>
2538 </div> 2538 </div>
2659 <p> 2659 <p>
2660 options ([+] can be repeated): 2660 options ([+] can be repeated):
2661 </p> 2661 </p>
2662 <table> 2662 <table>
2663 <tr><td>-A</td> 2663 <tr><td>-A</td>
2664 <td>--[no-]after</td> 2664 <td>--after</td>
2665 <td>record delete for missing files</td></tr> 2665 <td>record delete for missing files</td></tr>
2666 <tr><td>-f</td> 2666 <tr><td>-f</td>
2667 <td>--[no-]force</td> 2667 <td>--force</td>
2668 <td>forget added files, delete modified files</td></tr> 2668 <td>forget added files, delete modified files</td></tr>
2669 <tr><td>-S</td> 2669 <tr><td>-S</td>
2670 <td>--[no-]subrepos</td> 2670 <td>--subrepos</td>
2671 <td>recurse into subrepositories</td></tr> 2671 <td>recurse into subrepositories</td></tr>
2672 <tr><td>-I</td> 2672 <tr><td>-I</td>
2673 <td>--include PATTERN [+]</td> 2673 <td>--include PATTERN [+]</td>
2674 <td>include names matching the given patterns</td></tr> 2674 <td>include names matching the given patterns</td></tr>
2675 <tr><td>-X</td> 2675 <tr><td>-X</td>
2688 <td>change working directory</td></tr> 2688 <td>change working directory</td></tr>
2689 <tr><td>-y</td> 2689 <tr><td>-y</td>
2690 <td>--noninteractive</td> 2690 <td>--noninteractive</td>
2691 <td>do not prompt, automatically pick the first choice for all prompts</td></tr> 2691 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2692 <tr><td>-q</td> 2692 <tr><td>-q</td>
2693 <td>--[no-]quiet</td> 2693 <td>--quiet</td>
2694 <td>suppress output</td></tr> 2694 <td>suppress output</td></tr>
2695 <tr><td>-v</td> 2695 <tr><td>-v</td>
2696 <td>--[no-]verbose</td> 2696 <td>--verbose</td>
2697 <td>enable additional output</td></tr> 2697 <td>enable additional output</td></tr>
2698 <tr><td></td> 2698 <tr><td></td>
2699 <td>--config CONFIG [+]</td> 2699 <td>--config CONFIG [+]</td>
2700 <td>set/override config option (use 'section.name=value')</td></tr> 2700 <td>set/override config option (use 'section.name=value')</td></tr>
2701 <tr><td></td> 2701 <tr><td></td>
2702 <td>--[no-]debug</td> 2702 <td>--debug</td>
2703 <td>enable debugging output</td></tr> 2703 <td>enable debugging output</td></tr>
2704 <tr><td></td> 2704 <tr><td></td>
2705 <td>--[no-]debugger</td> 2705 <td>--debugger</td>
2706 <td>start debugger</td></tr> 2706 <td>start debugger</td></tr>
2707 <tr><td></td> 2707 <tr><td></td>
2708 <td>--encoding ENCODE</td> 2708 <td>--encoding ENCODE</td>
2709 <td>set the charset encoding (default: ascii)</td></tr> 2709 <td>set the charset encoding (default: ascii)</td></tr>
2710 <tr><td></td> 2710 <tr><td></td>
2711 <td>--encodingmode MODE</td> 2711 <td>--encodingmode MODE</td>
2712 <td>set the charset encoding mode (default: strict)</td></tr> 2712 <td>set the charset encoding mode (default: strict)</td></tr>
2713 <tr><td></td> 2713 <tr><td></td>
2714 <td>--[no-]traceback</td> 2714 <td>--traceback</td>
2715 <td>always print a traceback on exception</td></tr> 2715 <td>always print a traceback on exception</td></tr>
2716 <tr><td></td> 2716 <tr><td></td>
2717 <td>--[no-]time</td> 2717 <td>--time</td>
2718 <td>time how long the command takes</td></tr> 2718 <td>time how long the command takes</td></tr>
2719 <tr><td></td> 2719 <tr><td></td>
2720 <td>--[no-]profile</td> 2720 <td>--profile</td>
2721 <td>print command execution profile</td></tr> 2721 <td>print command execution profile</td></tr>
2722 <tr><td></td> 2722 <tr><td></td>
2723 <td>--version</td> 2723 <td>--version</td>
2724 <td>output version information and exit</td></tr> 2724 <td>output version information and exit</td></tr>
2725 <tr><td>-h</td> 2725 <tr><td>-h</td>
2726 <td>--help</td> 2726 <td>--help</td>
2727 <td>display help and exit</td></tr> 2727 <td>display help and exit</td></tr>
2728 <tr><td></td> 2728 <tr><td></td>
2729 <td>--[no-]hidden</td> 2729 <td>--hidden</td>
2730 <td>consider hidden changesets</td></tr> 2730 <td>consider hidden changesets</td></tr>
2731 </table> 2731 </table>
2732 2732
2733 </div> 2733 </div>
2734 </div> 2734 </div>