Overriding commands in plugins

Robert Collins robert.collins at canonical.com
Wed Mar 10 01:19:37 GMT 2010


On Wed, 2010-03-10 at 10:06 +1100, Martin Pool 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?
> 
> As Robert says, you could do it, but it seems a bit of a blunt
> instrument. 

I would say, if you want your change to apply to GUI's, and other
conceptual things like 'bzr down-thread' in a loom (that builds on
switch) - then you should be hooking into MutableTree or Branch or
whatnot. If you specifically want to affect the CLI, then hooking into a
specific Command object or wrapping one is appropriate.

We have plenty of examples of both, and many of them have turned out
well :)

-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/20100310/b4bb5d41/attachment.pgp 


More information about the bazaar mailing list