[MERGE] [RFC] Refactor plugin loading code

Jelmer Vernooij jelmer at vernstok.nl
Wed May 13 23:31:40 BST 2009


On Wed, May 13, 2009 at 05:20:07PM -0500, John Arbash Meinel wrote:
> Jelmer Vernooij wrote:
> > The attached patch refactors the plugin loading code a bit so we
> > remember the suffix tuple when finding plugins so we can use it for
> > loading them later. This saves a few stats, and will make it possible
> > to load individual plugins in the future (this is what I hope to work
> > on next).

> > The next step (and my next patch hopefully) will be supporting something like 
> > "bzr --with-plugin /foo/bar/bla".

> > Cheers,

> > Jelmer


> BB:comment

> I didn't do a full review, but I did notice that you changed the warning
> about invalid plugin names. You left the regex check in, but now it just
> raises a generic error. Rather then trying to give a more helpful
> "plugin contains invalid characters, you may want to rename it to XXX".
Actually, I did leave the original one in as well but since I changed
the way plugins are loaded python doesn't actually raise an exception
anymore so I had to raise that exception myself. This perhaps isn't
the cleanest way of dealing with this.

The attached patch simplifies this a bit and checks for invalid
characters first.

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plugin-refactor.diff
Type: text/x-diff
Size: 12123 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090514/1f3d2475/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090514/1f3d2475/attachment.pgp 


More information about the bazaar mailing list