/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Robert Collins
  • Date: 2010-02-26 04:43:31 UTC
  • mto: This revision was merged to the branch mainline in revision 5060.
  • Revision ID: robertc@robertcollins.net-20100226044331-es52r2tz8hy8j4xz
* ``bzr help`` will no longer trigger the get_missing_command hook when
  doing a topic lookup. This avoids prompting (like 'no command plugins/loom,
  did you mean log?') when getting help. In future we may trigger the hook 
  deliberately when no help topics match from any help index.
  (Robert Collins, #396261)

Show diffs side-by-side

added added

removed removed

Lines of Context:
199
199
        raise errors.BzrCommandError('unknown command "%s"' % cmd_name)
200
200
 
201
201
 
202
 
def _get_cmd_object(cmd_name, plugins_override=True):
 
202
def _get_cmd_object(cmd_name, plugins_override=True, check_missing=True):
203
203
    """Get a command object.
204
204
 
205
205
    :param cmd_name: The name of the command.
206
206
    :param plugins_override: Allow plugins to override builtins.
 
207
    :param check_missing: Look up commands not found in the regular index via
 
208
        the get_missing_command hook.
207
209
    :return: A Command object instance
208
210
    :raises KeyError: If no command is found.
209
211
    """
219
221
            # We've found a non-plugin command, don't permit it to be
220
222
            # overridden.
221
223
            break
222
 
    if cmd is None:
 
224
    if cmd is None and check_missing:
223
225
        for hook in Command.hooks['get_missing_command']:
224
226
            cmd = hook(cmd_name)
225
227
            if cmd is not None:
1162
1164
        if topic and topic.startswith(self.prefix):
1163
1165
            topic = topic[len(self.prefix):]
1164
1166
        try:
1165
 
            cmd = _get_cmd_object(topic)
 
1167
            cmd = _get_cmd_object(topic, check_missing=False)
1166
1168
        except KeyError:
1167
1169
            return []
1168
1170
        else: