[RFC] bzr help plugin-name

John Arbash Meinel john at arbash-meinel.com
Mon Jun 19 17:15:56 BST 2006


Robert Collins wrote:
> On Mon, 2006-06-19 at 10:37 -0500, John Arbash Meinel wrote:
>> Robert Collins wrote:
>>> I think it would be nice if 'bzr help <pluginname>' were to show the
>>> docstring from the plugin. This would allow plugins that introduce a
>>> number of commands to have a single place to give conceptual guidance
>>> and help - one that users can be taught how to predict.
>>>
>>> Rob
>> This goes back into having plugins export a 'canonical' name. Otherwise
>> I may work like mpe and have 01_shelf, or bzrtools-baz2bzr, or
>> bzrtools-lifeless, etc.
> 
> They already have a canonical name - documented in the plugin loader
> code IIRC. Its 'bzrlib.plugins.pluginname'. In python 2.5 it may be
> reasonable to relax this and have plugins do their internal imports
> relatively, but I think thats not helpful, because plugins should be
> accessible to other plugins - if I have a plugin 'guisupport', I should
> be able to do 'import bzrlib.plugins.guisupport' in 'bzrk'. Currently we
> dont have that, because I have not written an import hook for
> 'bzrlib.plugins' yet - but I should do that - we can make our plugin
> importer much nicer :).

But that means on mpe's system they are now called:

bzrlib.plugins.01_shelf.shelf

And on my system it is called:
bzrlib.plugins.bzrtools-baz2bzr.shelf

Yes, most people just use the name of the branch that was given to them.
 But there is no restriction that the name on disk be anything that even
resembles a valid python identifier.

I'm advocating that we change the importer to check the plugin for its
'canonical' name, and preferentially use that. So if I install
'bzrtools-from-lifeless', it would try to install itself as:
bzrlib.plugins.bzrtools.

(And maybe also as bzrlib.plugins.'bzrtools-lifeless')

More importantly, people can use naming to force an import order, which
I think is a good thing. But would mean that none of the plugin names
could be found in the bzrlib.plugins.* namespace. Which breaks the
webserve plugin/cgi.

> 
>> But I agree, it would be nice to have 'bzr help pluginname'.
>> Maybe 'bzr help plugins.<pluginname>' to disambiguate for plugins that
>> export commands of the same name.
>>
>> Or 'bzr help --plugin <pluginname>' or 'bzr help plugin <pluginname>'
>>
>> I probably like the last one the most.
> 
> I'm fine with the last one, but prefer 'bzr help <pluginname>' with 'bzr
> help plugin <pluginname>' as an additional syntax people can use if they
> need to disambiguate.
> 
> Rob

I agree.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060619/aa6491b6/attachment.pgp 


More information about the bazaar mailing list