Show More
@@ -453,7 +453,7 def inserttweakrc(ui, topic, doc): | |||||
453 | addtopichook('config', inserttweakrc) |
|
453 | addtopichook('config', inserttweakrc) | |
454 |
|
454 | |||
455 | def help_(ui, commands, name, unknowncmd=False, full=True, subtopic=None, |
|
455 | def help_(ui, commands, name, unknowncmd=False, full=True, subtopic=None, | |
456 | **opts): |
|
456 | fullname=None, **opts): | |
457 | ''' |
|
457 | ''' | |
458 | Generate the help for 'name' as unformatted restructured text. If |
|
458 | Generate the help for 'name' as unformatted restructured text. If | |
459 | 'name' is None, describe the commands available. |
|
459 | 'name' is None, describe the commands available. | |
@@ -814,8 +814,16 def help_(ui, commands, name, unknowncmd | |||||
814 | if unknowncmd: |
|
814 | if unknowncmd: | |
815 | raise error.UnknownCommand(name) |
|
815 | raise error.UnknownCommand(name) | |
816 | else: |
|
816 | else: | |
817 | msg = _('no such help topic: %s') % name |
|
817 | if fullname: | |
818 | hint = _("try 'hg help --keyword %s'") % name |
|
818 | formatname = fullname | |
|
819 | else: | |||
|
820 | formatname = name | |||
|
821 | if subtopic: | |||
|
822 | hintname = subtopic | |||
|
823 | else: | |||
|
824 | hintname = name | |||
|
825 | msg = _('no such help topic: %s') % formatname | |||
|
826 | hint = _("try 'hg help --keyword %s'") % hintname | |||
819 | raise error.Abort(msg, hint=hint) |
|
827 | raise error.Abort(msg, hint=hint) | |
820 | else: |
|
828 | else: | |
821 | # program name |
|
829 | # program name | |
@@ -850,7 +858,7 def formattedhelp(ui, commands, fullname | |||||
850 | termwidth = ui.termwidth() - 2 |
|
858 | termwidth = ui.termwidth() - 2 | |
851 | if textwidth <= 0 or termwidth < textwidth: |
|
859 | if textwidth <= 0 or termwidth < textwidth: | |
852 | textwidth = termwidth |
|
860 | textwidth = termwidth | |
853 | text = help_(ui, commands, name, |
|
861 | text = help_(ui, commands, name, fullname=fullname, | |
854 | subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts) |
|
862 | subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts) | |
855 |
|
863 | |||
856 | blocks, pruned = minirst.parse(text, keep=keep) |
|
864 | blocks, pruned = minirst.parse(text, keep=keep) |
@@ -1303,6 +1303,13 sub-topics can be accessed | |||||
1303 | *empty chunk* at the end of each *delta group* denotes the boundary to the |
|
1303 | *empty chunk* at the end of each *delta group* denotes the boundary to the | |
1304 | next filelog sub-segment. |
|
1304 | next filelog sub-segment. | |
1305 |
|
1305 | |||
|
1306 | non-existent subtopics print an error | |||
|
1307 | ||||
|
1308 | $ hg help internals.foo | |||
|
1309 | abort: no such help topic: internals.foo | |||
|
1310 | (try 'hg help --keyword foo') | |||
|
1311 | [255] | |||
|
1312 | ||||
1306 | test advanced, deprecated and experimental options are hidden in command help |
|
1313 | test advanced, deprecated and experimental options are hidden in command help | |
1307 | $ hg help debugoptADV |
|
1314 | $ hg help debugoptADV | |
1308 | hg debugoptADV |
|
1315 | hg debugoptADV |
General Comments 0
You need to be logged in to leave comments.
Login now