help: don't crash on help for 'sections' with multiple '.' stable
authorMads Kiilerich <madski@unity3d.com>
Sat, 01 Nov 2014 19:02:31 +0100
branchstable
changeset 23122 d9e3f5055772
parent 23121 7a3f715dfa90
child 23123 c26b7a810749
help: don't crash on help for 'sections' with multiple '.'
mercurial/commands.py
tests/test-help.t
--- a/mercurial/commands.py	Sat Nov 01 18:28:54 2014 +0100
+++ b/mercurial/commands.py	Sat Nov 01 19:02:31 2014 +0100
@@ -3837,7 +3837,7 @@
 
     section = None
     if name and '.' in name:
-        name, section = name.split('.')
+        name, section = name.split('.', 1)
 
     text = help.help_(ui, name, **opts)
 
--- a/tests/test-help.t	Sat Nov 01 18:28:54 2014 +0100
+++ b/tests/test-help.t	Sat Nov 01 19:02:31 2014 +0100
@@ -1094,6 +1094,10 @@
   abort: help section not found
   [255]
 
+  $ hg help glossary.mc.guffin
+  abort: help section not found
+  [255]
+
 Test usage of section marks in help documents
 
   $ cd "$TESTDIR"/../doc