[MERGE] Command Not Found core code

Martin Albisetti argentina at gmail.com
Mon Mar 3 21:22:56 GMT 2008

On Mon, Mar 3, 2008 at 6:59 PM, James Westby <jw+debian at jameswestby.net> wrote:
>  > +    # look for plugins that provide this command but aren't
>  > installed
>  > +    for provider in command_providers_registry:
>  > +        try:
>  > +            plugin_metadata = provider.plugin_for_command(cmd_name)
>  > +        except errors.NoPluginAvailable:
>  > +            pass
>  > +        else:
>  > +            raise errors.CommandAvailableInPlugin(cmd_name,
>  > plugin_metadata, provider)
>  >
>  Is
>   try:
>     ...
>   except:
>     ...
>   else:
>     ...
>  a python2.5ism? I thought I read something the other day that said it
>  was. I don't have 2.4 installed to check though I'm afraid.

Seems right, I'll fix this for python 2.4 compatibility.

>  I'm not familiar with registries, is there some sort of ordering
>  involved? I'm assuming the apt plugin will add an entry in this
>  registry, and then want to be preferred if it has the particular plugin.

Each provider will add an entry to this, and the last one will always
be de "default" one, which would be checkouts.
This last bit of automatically pushing the default as the last
possible provider is still absent as the "more than one" provider is
still a bit out of scope. I hope to get that nailed down during the
sprint and continue work on that (that would include the default
checkout installer, which is half-way coded).

>  How does a method change the message that is printed if it has the
>  plugin in question? The apt one will want to tell the user apt-get
>  install, rather than a URL to find it.

Actually, the message in the end will be the same:
"X command is not currently available, but a plugin does provide it.
Run: 'bzr install-plugin X' to install it" (or something similar).

So the "install-plugin" command would try the current registered
providers in order and finally fall back to checkouts if none
othercould provide it.
This way, whatever each distro installs by default will be the
preferred one, but the user will still be able to get it if it's not

>  Also, I think we want some sort of fallback, for instance the apt
>  method can only install system wide, so if the user doesn't have root
>  we want to say
>    apt-get install bzr-svn
>    OR
>    bzr checkout wherever ~/.bazaar/plugins/

That's exactly the idea  :D

>  This may just be a first pass ignoring these issues, and if that is the
>  case then please feel free to disregard these comments.

Not at all. Any comments are welcome, and probably more so during this
week that I can dedicate 24/7 to it.



More information about the bazaar mailing list