tests/test-help.t
changeset 17837 b623e323c561
parent 17717 009db477c9fb
child 17981 e689b0d91546
--- a/tests/test-help.t	Thu Oct 18 23:55:15 2012 -0500
+++ b/tests/test-help.t	Thu Oct 18 10:31:15 2012 +0900
@@ -279,7 +279,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help add" to show more info
+  use "hg -v help add" to show more complete help and the global options
 
 Verbose help for add
 
@@ -397,7 +397,7 @@
   
       Returns 0 on success, 1 if errors are encountered.
   
-  use "hg -v help verify" to show more info
+  use "hg -v help verify" to show the global options
 
   $ hg help diff
   hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
@@ -450,7 +450,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help diff" to show more info
+  use "hg -v help diff" to show more complete help and the global options
 
   $ hg help status
   hg status [OPTION]... [FILE]...
@@ -513,7 +513,7 @@
   
   [+] marked option can be specified multiple times
   
-  use "hg -v help status" to show more info
+  use "hg -v help status" to show more complete help and the global options
 
   $ hg -q help status
   hg status [OPTION]... [FILE]...
@@ -599,7 +599,7 @@
   
   (no help text available)
   
-  use "hg -v help nohelp" to show more info
+  use "hg -v help nohelp" to show the global options
 
   $ hg help -k nohelp
   Commands:
@@ -805,6 +805,75 @@
   
    qclone clone main and patch repository at same time
 
+Test omit indicating for help
+
+  $ cat > addverboseitems.py <<EOF
+  > '''extension to test omit indicating.
+  > 
+  > This paragraph is never omitted (for extension)
+  > 
+  > .. container:: verbose
+  > 
+  >   This paragraph is omitted,
+  >   if :hg:\`help\` is invoked witout \`\`-v\`\` (for extension)
+  > 
+  > This paragraph is never omitted, too (for extension)
+  > '''
+  > 
+  > from mercurial import help, commands
+  > testtopic = """This paragraph is never omitted (for topic).
+  > 
+  > .. container:: verbose
+  > 
+  >   This paragraph is omitted,
+  >   if :hg:\`help\` is invoked witout \`\`-v\`\` (for topic)
+  > 
+  > This paragraph is never omitted, too (for topic)
+  > """
+  > def extsetup(ui):
+  >     help.helptable.append((["topic-containing-verbose"],
+  >                            "This is the topic to test omit indicating.",
+  >                            lambda : testtopic))
+  > EOF
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
+  $ hg help addverboseitems
+  addverboseitems extension - extension to test omit indicating.
+  
+  This paragraph is never omitted (for extension)
+  
+  This paragraph is never omitted, too (for extension)
+  
+  use "hg help -v addverboseitems" to show more complete help
+  
+  no commands defined
+  $ hg help -v addverboseitems
+  addverboseitems extension - extension to test omit indicating.
+  
+  This paragraph is never omitted (for extension)
+  
+  This paragraph is omitted, if "hg help" is invoked witout "-v" (for extension)
+  
+  This paragraph is never omitted, too (for extension)
+  
+  no commands defined
+  $ hg help topic-containing-verbose
+  This is the topic to test omit indicating.
+  
+      This paragraph is never omitted (for topic).
+  
+      This paragraph is never omitted, too (for topic)
+  
+  use "hg help -v topic-containing-verbose" to show more complete help
+  $ hg help -v topic-containing-verbose
+  This is the topic to test omit indicating.
+  
+      This paragraph is never omitted (for topic).
+  
+      This paragraph is omitted, if "hg help" is invoked witout "-v" (for topic)
+  
+      This paragraph is never omitted, too (for topic)
+
 Test usage of section marks in help documents
 
   $ cd "$TESTDIR"/../doc