Help issues
John Arbash Meinel
john at arbash-meinel.com
Tue Jan 31 15:08:41 GMT 2006
Aaron Bentley wrote:
> John Arbash Meinel wrote:
>
>>> The problem is that '--no-plugins' really isn't good enough. I've done
>>> some testing, and while it doesn't load the tests for plugins, it still
>>> ends up loading the plugins after a 'run_bzr' command. So you actually
>>> have to use BZR_PLUGIN_PATH='' to truly not load plugins.
>
> Also, last I checked, bzr --no-plugins would also load plugins from
> bzrlib/plugins.
>
> Aaron
Actually, looking at the code, BZR_PLUGIN_PATH='' will still load the
bzrlib/plugins/* plugins, because that location is forced to be on the path.
The enclosed patch actually makes it so that 'bzr --no-plugins' really
means no plugins.
I don't really know any way to test this, since the whole point is that
it is fixing our test setup.
But if someone gives me a +1, I'll put it into jam-integration.
John
=:->
=== modified file 'bzrlib/commands.py'
--- bzrlib/commands.py
+++ bzrlib/commands.py
@@ -520,6 +520,9 @@
if not opt_no_plugins:
from bzrlib.plugin import load_plugins
load_plugins()
+ else:
+ from bzrlib.plugin import disable_plugins
+ disable_plugins()
cmd = str(argv.pop(0))
=== modified file 'bzrlib/plugin.py'
--- bzrlib/plugin.py
+++ bzrlib/plugin.py
@@ -64,6 +64,17 @@
if isinstance(plugin, types.ModuleType):
result[name] = plugin
return result
+
+
+def disable_plugins():
+ """Disable loading plugins.
+
+ Future calls to load_plugins() will be ignored.
+ """
+ # TODO: jam 20060131 This should probably also disable
+ # load_from_dirs()
+ global _loaded
+ _loaded = True
def load_plugins():
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060131/e8893ede/attachment.pgp
More information about the bazaar
mailing list