Show More
@@ -4020,7 +4020,11 b' def help_(ui, name=None, **opts):' | |||||
4020 |
|
4020 | |||
4021 | formatted, pruned = minirst.format(text, textwidth, keep=keep, |
|
4021 | formatted, pruned = minirst.format(text, textwidth, keep=keep, | |
4022 | section=section) |
|
4022 | section=section) | |
4023 | if section and not formatted: |
|
4023 | ||
|
4024 | # We could have been given a weird ".foo" section without a name | |||
|
4025 | # to look for, or we could have simply failed to found "foo.bar" | |||
|
4026 | # because bar isn't a section of foo | |||
|
4027 | if section and not (formatted and name): | |||
4024 | raise util.Abort(_("help section not found")) |
|
4028 | raise util.Abort(_("help section not found")) | |
4025 |
|
4029 | |||
4026 | if 'verbose' in pruned: |
|
4030 | if 'verbose' in pruned: |
@@ -253,7 +253,7 b' def _runcatch(req):' | |||||
253 | # check if the command is in a disabled extension |
|
253 | # check if the command is in a disabled extension | |
254 | # (but don't check for extensions themselves) |
|
254 | # (but don't check for extensions themselves) | |
255 | commands.help_(ui, inst.args[0], unknowncmd=True) |
|
255 | commands.help_(ui, inst.args[0], unknowncmd=True) | |
256 | except error.UnknownCommand: |
|
256 | except (error.UnknownCommand, util.Abort): | |
257 | suggested = False |
|
257 | suggested = False | |
258 | if len(inst.args) == 2: |
|
258 | if len(inst.args) == 2: | |
259 | sim = _getsimilar(inst.args[1], inst.args[0]) |
|
259 | sim = _getsimilar(inst.args[1], inst.args[0]) |
@@ -616,6 +616,23 b' Test command without options' | |||||
616 | [255] |
|
616 | [255] | |
617 |
|
617 | |||
618 |
|
618 | |||
|
619 | Make sure that we don't run afoul of the help system thinking that | |||
|
620 | this is a section and erroring out weirdly. | |||
|
621 | ||||
|
622 | $ hg .log | |||
|
623 | hg: unknown command '.log' | |||
|
624 | (did you mean one of log?) | |||
|
625 | [255] | |||
|
626 | ||||
|
627 | $ hg log. | |||
|
628 | hg: unknown command 'log.' | |||
|
629 | (did you mean one of log?) | |||
|
630 | [255] | |||
|
631 | $ hg pu.lh | |||
|
632 | hg: unknown command 'pu.lh' | |||
|
633 | (did you mean one of pull, push?) | |||
|
634 | [255] | |||
|
635 | ||||
619 | $ cat > helpext.py <<EOF |
|
636 | $ cat > helpext.py <<EOF | |
620 | > import os |
|
637 | > import os | |
621 | > from mercurial import cmdutil, commands |
|
638 | > from mercurial import cmdutil, commands |
General Comments 0
You need to be logged in to leave comments.
Login now