[MERGE] Give full control over plugins to bzrlib clients

Aaron Bentley aaron at aaronbentley.com
Thu Nov 13 23:59:00 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> On Thu, 2008-11-13 at 15:33 -0500, Aaron Bentley wrote:
> I'm replying to this conceptual level stuff now; once we have consensus
> here I will happily review the code.
> 
>> The plugin path is no longer set when bzrlib is imported.  Clients that
>> want a plugin path set should call set_plugins_path.
> 
> I'd like to understand more about why this is needed/good. It seems
> wrong to me that everyone enabling bzrlib plugins would have to do
> bzrlib.plugin.set_plugins_path()
> bzrlib.plugin.load_plugins()

load_plugins already calls set_plugins_path.  I have not changed this.
See diff.

The only reason a client would call set_plugins_path would be if they
did not want to call load_plugins.

>> load_plugins now allows clients to specify exactly which path should be
>> used.  This allows clients to avoid importing plugins from system plugin
>> location.
> 
> I like this part as long as its optional to specify the path.

Of course.

>> Finally, I've removed Vincent's colordiff change, since it is no longer
>> needed to make "bzr selftest --no-plugins" work correctly.
> 
> I think vincent's change was an improvement, because it allows different
> plugins to set the colour code.

I think it was a disimprovement, because it wasn't the color code that
they set, it was the diff writer.  And since we didn't know what the
diff writer did, we couldn't reasonably provide a --no-color option, as
people requested.

If we import from bzrlib.colordiff, we can be pretty confident in
providing a --no-color option.  But I want to pursue the registry anyhow.

>> There are no tests, because plugin machinery is hard to test.
> 
> There are plenty of existing tests; I'm happy to give pointers on how to
> extend them;

I'll look into this.  I will note that the code which called
set_plugins_path at bzrlib import time was not tested.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkcv0MACgkQ0F+nu1YWqI1QewCdFvyJKb4H9pYZpkaUnvZin5tS
J8cAnjz8JVO5rTJwhNkGPpGawEclmRMh
=CB8k
-----END PGP SIGNATURE-----



More information about the bazaar mailing list