# HG changeset patch # User Matt Mackall # Date 2014-07-31 19:31:31 # Node ID af15de6775c73b66e4ad08d1cfb084935eb80015 # Parent 2896d450fec495e8f043a68117f40fcf24619d4f help: always show command help with -h (issue4240) Old behavior: hg help x hg x -h hg help -e x hg help -c x config topic topic (!) - cmd showconfig cmd topic (!) - cmd rebase cmd cmd ext cmd New behavior: hg help x hg x -h hg help -e x hg help -c x config topic cmd - cmd showconfig cmd cmd - cmd rebase cmd cmd ext cmd diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -766,7 +766,7 @@ def _dispatch(req): if options['version']: return commands.version_(ui) if options['help']: - return commands.help_(ui, cmd) + return commands.help_(ui, cmd, command=True) elif not cmd: return commands.help_(ui, 'shortlist') diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -862,6 +862,17 @@ test deprecated option is hidden with tr *"hg -v help debugoptDEP"* (glob) #endif +Test commands that collide with topics (issue4240) + + $ hg config -hq + hg config [-u] [NAME]... + + show combined config settings from all hgrc files + $ hg showconfig -hq + hg config [-u] [NAME]... + + show combined config settings from all hgrc files + Test a help topic $ hg help revs