changeset 21961:af15de6775c7 stable

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
author Matt Mackall <mpm@selenic.com>
date Thu, 31 Jul 2014 14:31:31 -0500
parents 2896d450fec4
children 315cb6f5156a
files mercurial/dispatch.py tests/test-help.t
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Fri Aug 01 02:14:24 2014 +0900
+++ b/mercurial/dispatch.py	Thu Jul 31 14:31:31 2014 -0500
@@ -766,7 +766,7 @@
     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')
 
--- a/tests/test-help.t	Fri Aug 01 02:14:24 2014 +0900
+++ b/tests/test-help.t	Thu Jul 31 14:31:31 2014 -0500
@@ -862,6 +862,17 @@
   *"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