[MERGE] Make command discovery entirely callback driven.

Ian Clatworthy ian.clatworthy at internode.on.net
Mon Jun 15 08:03:25 BST 2009


Robert Collins wrote:

>> It's
>> not a big deal and I certainly won't block on having both - I just
>> can't
>> see why you need get_missing_command() in it's current form.
> 
> install the 'cmd-heuristic' plugin (hypothetical, its on my TODO).
> bzr commti
> get_command:
>  every plugin passes
> get_missing_command:
>  the plugin-lookup fails
>  the cmd-heuristic lookup does a list_commands and then calculates a
>   string distance for all commands against 'commti', decides that commit
>   is close enough and returns that command object.
> 
> If you just have get_command and get_missing_command raising, then the
> order in which lookups are done matters because the heuristic check I'm
> mentioning would have to run *after* all other lookups and *before* the
> missing command hook, or else it would mask some plugins, or never run.

Ok. I get it now.

>>>>> +def get_all_cmds():

>>>>>      d = _builtin_commands()
>>>>>      if plugins_override:

So I'm trying to say that this variable is still used in the code I
reviewed, but isn't declared as a parameter any more. Maybe you've
changed the code since ...

> remaining issues:
>  - do we need to warn people off from using the hooks

We don't need to warn them off - just let them know that they aren't
*required* to use them to register a command in a plugin.

Ian C.



More information about the bazaar mailing list