# HG changeset patch # User timeless # Date 2015-12-09 19:09:35 # Node ID 5456374561a7a81eb60864cf28a4d8535a6b3e63 # Parent 0fe93498ef07741f1e22fb13d2b36a94afdf859e help: call filtercmd from topicmatch update test coverage to explicitly define when help -c should list debug/deprecated items. diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -124,6 +124,8 @@ def topicmatch(ui, kw): if doclines: summary = doclines[0] cmdname = cmd.partition('|')[0].lstrip('^') + if filtercmd(ui, cmdname, kw, docs): + continue results['commands'].append((cmdname, summary)) for name, docs in itertools.chain( extensions.enabled(False).iteritems(), diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -1041,6 +1041,16 @@ Test help hooks helphook1 helphook2 +help -c should only show debug --debug + + $ hg help -c --debug|grep debug|wc -l|grep '^\s*0\s*$' + [1] + +help -c should only show deprecated for -v + + $ hg help -c -v|grep DEPRECATED|wc -l|grep '^\s*0\s*$' + [1] + Test -e / -c / -k combinations $ hg help -c schemes @@ -1083,12 +1093,10 @@ Test keyword search help Commands: - bookmarks create a new bookmark or list existing bookmarks - clone make a copy of an existing repository - debugapplystreamclonebundle apply a stream clone bundle file - debugcreatestreamclonebundle create a stream clone bundle file - paths show aliases for remote repositories - update update working directory (or switch revisions) + bookmarks create a new bookmark or list existing bookmarks + clone make a copy of an existing repository + paths show aliases for remote repositories + update update working directory (or switch revisions) Extensions: