Rev 2446: Switch help.help to using HelpContexts completely, fixing bug 107656. in file:///home/robertc/source/baz/help-contexts/

Robert Collins robertc at robertcollins.net
Fri Apr 20 03:32:15 BST 2007


At file:///home/robertc/source/baz/help-contexts/

------------------------------------------------------------
revno: 2446
revision-id: robertc at robertcollins.net-20070420023210-tqvs66j9cucmm7li
parent: robertc at robertcollins.net-20070420022005-a291lv2j0c18urai
committer: Robert Collins <robertc at robertcollins.net>
branch nick: help-contexts
timestamp: Fri 2007-04-20 12:32:10 +1000
message:
  Switch help.help to using HelpContexts completely, fixing bug 107656.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/help.py                 help.py-20050505025907-4dd7a6d63912f894
=== modified file 'NEWS'
--- a/NEWS	2007-04-19 20:05:32 +0000
+++ b/NEWS	2007-04-20 02:32:10 +0000
@@ -21,6 +21,9 @@
       documentation, and the bzr.1 man page also include this information.
       (Robert Collins)
 
+    * ``bzr help`` provides a clearer message when a help topic cannot be
+      found (fixes bug 107656). (Robert Collins)
+
   INTERNALS:
 
     * bzrlib API compatability with 0.8 has been dropped, cleaning up some

=== modified file 'bzrlib/help.py'
--- a/bzrlib/help.py	2007-04-20 01:57:10 +0000
+++ b/bzrlib/help.py	2007-04-20 02:32:10 +0000
@@ -37,14 +37,9 @@
     if outfile is None:
         outfile = sys.stdout
 
-    topic_context = help_topics.HelpTopicContext()
-    topics = topic_context.get_topics(topic)
-    if topics:
-        outfile.write(topics[0].get_help_text())
-    else:
-        cmdname = str(topic)
-        cmd_object = _mod_commands.get_cmd_object(cmdname)
-        outfile.write(cmd_object.get_help_text())
+    contexts = HelpContexts()
+    topics = contexts.search(topic)
+    outfile.write(topics[0].get_help_text())
 
 
 def help_commands(outfile=None):



More information about the bazaar-commits mailing list