Doesn't know about non-command help topics

Bug #396261 reported by Matt Nordhoff
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Undecided
Robert Collins
bzr-guess
Confirmed
Wishlist
Unassigned

Bug Description

This is likely the fault of bzr's help infrastructure, but...

Look:

$ bzr help hidden-commands
Command 'hidden-commands' not found, perhaps you meant 'sign-my-commits'? [y/n]: n
added List files added in working tree.
...

$ bzr help topics
Command 'topics' not found, perhaps you meant 'rocks'? [y/n]: n
authentication Information on configuring authentication
...

bzr-guess doesn't seem to think these topics exist, even though the help information comes up normally after I dismiss its prompt.

bzr.dev r4512, bzr-guess r1.

Related branches

description: updated
description: updated
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 396261] [NEW] Doesn't know about non-command help topics

 status confirmed
 importance critical

If you want to fix it, I suggest querying for topics and if the command
being looked up is a topic just bail out with None early. This is
happening because the 'command' help topic just asks for the command.
Doing what I suggest here will mean that 'bzr hidden-commands' will
return no such command and not suggest one - which I think is fine.

-Rob

Changed in bzr-guess:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Robert Collins (lifeless) wrote :

Thinking about this more, some other options that might be better.
 - stop guessing when doing help
 - add a similar mechanism to help for 'nothing found' and use that to do the same thing for help topics, when nothing is found

Revision history for this message
Marius Kruger (amanica) wrote :

it became unbearable to not have bash auto completion of bzr commands, so I did a quick and dirty fix.
see linked branch.

Revision history for this message
Vincent Ladeuil (vila) wrote :

A bare 'bzr help' gives:

bzr help
bzr: ERROR: exceptions.SystemError: NULL result without error in PyObject_Call

Traceback (most recent call last):
  File "/home/vila/src/bzr/trunk/bzrlib/commands.py", line 843, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/vila/src/bzr/trunk/bzrlib/commands.py", line 1044, in run_bzr
    ret = run(*run_argv)
  File "/home/vila/src/bzr/trunk/bzrlib/commands.py", line 655, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/vila/src/bzr/trunk/bzrlib/commands.py", line 1059, in ignore_pipe
    result = func(*args, **kwargs)
  File "/home/vila/src/bzr/trunk/bzrlib/builtins.py", line 4158, in run
    bzrlib.help.help(topic)
  File "/home/vila/src/bzr/trunk/bzrlib/help.py", line 46, in help
    topics = indices.search(topic)
  File "/home/vila/src/bzr/trunk/bzrlib/help.py", line 156, in search
    result.extend([(index, _topic) for _topic in index.get_topics(topic)])
  File "/home/vila/src/bzr/trunk/bzrlib/commands.py", line 1172, in get_topics
    cmd = _get_cmd_object(topic)
  File "/home/vila/src/bzr/trunk/bzrlib/commands.py", line 238, in _get_cmd_object
    cmd = hook(cmd_name)
  File "/home/vila/.bazaar/plugins/guess/__init__.py", line 38, in guess_command
    matcher = patiencediff.PatienceSequenceMatcher(None, cmd_name, name)
SystemError: NULL result without error in PyObject_Call

bzr 2.1.0dev4 on python 2.6.4 (Linux-2.6.31-15-generic-x86_64-with-Ubuntu-9.10-karmic)
arguments: ['/home/vila/bin/bzr', 'help']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bookmarks /home/vila/.bazaar/plugins/bookmarks [unknown]
  builddeb /home/vila/.bazaar/plugins/builddeb [2.1.1dev]
  builder /home/vila/.bazaar/plugins/builder [unknown]
  bzrtools /home/vila/.bazaar/plugins/bzrtools [2.1.0b1]
  diffstat /home/vila/.bazaar/plugins/diffstat [0.2.0]
  email /home/vila/.bazaar/plugins/email [unknown]
  explorer /home/vila/.bazaar/plugins/explorer [0.10.0dev]
  fix277537 /home/vila/.bazaar/plugins/fix277537 [unknown]
  gtk /home/vila/.bazaar/plugins/gtk [0.98.0dev1]
  guess /home/vila/.bazaar/plugins/guess [unknown]
  launchpad /home/vila/src/bzr/trunk/bzrlib/plugins/launchpad [2.1.0dev4]
  local_test_server /home/vila/.bazaar/plugins/local_test_server [unknown]
  loom /home/vila/.bazaar/plugins/loom [1.4.0dev]
  netrc_credential_store /home/vila/src/bzr/trunk/bzrlib/plugins/netrc_credential_store [2.1.0dev4]
  qbzr /home/vila/.bazaar/plugins/qbzr [0.17.0dev]
  stats /home/vila/.bazaar/plugins/stats [unknown]
  upload /home/vila/.bazaar/plugins/upload [1.0.0dev]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

I fixed it, went to report the bug, saw he fixed it in the same way.

Vincent Ladeuil (vila)
Changed in bzr-guess:
assignee: nobody → Marius Kruger (amanica)
status: Confirmed → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
Robert Collins (lifeless) wrote :

So, bzr.dev now has a permanent fix, we should, after 2.2.0 is released, remove the stack inspection code from bzr-guess.

Changed in bzr:
status: New → Fix Released
Changed in bzr-guess:
status: Fix Released → Confirmed
Changed in bzr:
assignee: nobody → Robert Collins (lifeless)
milestone: none → 2.2.0b1
Changed in bzr-guess:
assignee: Marius Kruger (amanica) → nobody
importance: Critical → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.