Overriding commands in plugins
Robert Collins
robertc at robertcollins.net
Tue Mar 9 09:43:58 GMT 2010
On Tue, 2010-03-09 at 08:56 +0000, Michael Gliwinski wrote:
>
> I noticed the command hooks yesterday, from what I understand they
> are
> actually run when the command object is created, yes? Would that be
> valid to
> wrap the run method in a hook?
You can use the get_command hook to do this; its what its designed for -
wrapping or replacing command objects. You can build a stack : e.g.
foo-plugin(qbzr(pipeline(builtin))))
however, the run() method will be tricky because we pass parameters to
run() - I'd like to change that.
That said, run_argv is safe to use - but not safe to call anymore since
the changes made to add cleanups to commands. We need to document that,
deprecate run_argv. Instead there is a 'run direct' method which is
probably safe.
-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20100309/7d14f45a/attachment.pgp
More information about the bazaar
mailing list