Show More
@@ -349,12 +349,13 b' def disabledcmd(ui, cmd, strict=False):' | |||||
349 |
|
349 | |||
350 | raise error.UnknownCommand(cmd) |
|
350 | raise error.UnknownCommand(cmd) | |
351 |
|
351 | |||
352 | def enabled(): |
|
352 | def enabled(shortname=True): | |
353 | '''return a dict of {name: desc} of extensions''' |
|
353 | '''return a dict of {name: desc} of extensions''' | |
354 | exts = {} |
|
354 | exts = {} | |
355 | for ename, ext in extensions(): |
|
355 | for ename, ext in extensions(): | |
356 | doc = (gettext(ext.__doc__) or _('(no help text available)')) |
|
356 | doc = (gettext(ext.__doc__) or _('(no help text available)')) | |
357 | ename = ename.split('.')[-1] |
|
357 | if shortname: | |
|
358 | ename = ename.split('.')[-1] | |||
358 | exts[ename] = doc.splitlines()[0].strip() |
|
359 | exts[ename] = doc.splitlines()[0].strip() | |
359 |
|
360 | |||
360 | return exts |
|
361 | return exts |
@@ -103,10 +103,11 b' def topicmatch(kw):' | |||||
103 | cmdname = cmd.split('|')[0].lstrip('^') |
|
103 | cmdname = cmd.split('|')[0].lstrip('^') | |
104 | results['commands'].append((cmdname, summary)) |
|
104 | results['commands'].append((cmdname, summary)) | |
105 | for name, docs in itertools.chain( |
|
105 | for name, docs in itertools.chain( | |
106 | extensions.enabled().iteritems(), |
|
106 | extensions.enabled(False).iteritems(), | |
107 | extensions.disabled().iteritems()): |
|
107 | extensions.disabled().iteritems()): | |
108 | # extensions.load ignores the UI argument |
|
108 | # extensions.load ignores the UI argument | |
109 | mod = extensions.load(None, name, '') |
|
109 | mod = extensions.load(None, name, '') | |
|
110 | name = name.split('.')[-1] | |||
110 | if lowercontains(name) or lowercontains(docs): |
|
111 | if lowercontains(name) or lowercontains(docs): | |
111 | # extension docs are already translated |
|
112 | # extension docs are already translated | |
112 | results['extensions'].append((name, docs.splitlines()[0])) |
|
113 | results['extensions'].append((name, docs.splitlines()[0])) |
@@ -773,6 +773,12 b' Test help hooks' | |||||
773 |
|
773 | |||
774 | Test keyword search help |
|
774 | Test keyword search help | |
775 |
|
775 | |||
|
776 | $ cat > prefixedname.py <<EOF | |||
|
777 | > '''matched against word "clone" | |||
|
778 | > ''' | |||
|
779 | > EOF | |||
|
780 | $ echo '[extensions]' >> $HGRCPATH | |||
|
781 | $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH | |||
776 | $ hg help -k clone |
|
782 | $ hg help -k clone | |
777 | Topics: |
|
783 | Topics: | |
778 |
|
784 | |||
@@ -792,7 +798,8 b' Test keyword search help' | |||||
792 |
|
798 | |||
793 | Extensions: |
|
799 | Extensions: | |
794 |
|
800 | |||
795 | relink recreates hardlinks between repository clones |
|
801 | prefixedname matched against word "clone" | |
|
802 | relink recreates hardlinks between repository clones | |||
796 |
|
803 | |||
797 | Extension Commands: |
|
804 | Extension Commands: | |
798 |
|
805 |
General Comments 0
You need to be logged in to leave comments.
Login now