[MERGE] Support for the decorate argument also in CommandRegistry.register_lazy

John Arbash Meinel john at arbash-meinel.com
Fri Dec 19 19:26:56 GMT 2008

John Arbash Meinel has voted comment.
Status is now: Waiting
I'm not a big fan of "decorate" because it isn't supposed to mean 
"replace something that already exists", it means "I want to use the one 
that exists, but layer my work on top of it."
As such, having 2 plugins defining the same command means that one will 
get loaded, but you don't really know which one. (Ordering is not 
guaranteed.) Which is why we don't let 2 plugins provide the same 
command. Unless you really are *decorating* which, at least in theory, 
means that both implementations get used, with one being stacked higher 
than the other one.

But more importantly, I don't think register_lazy is compatible with 
proper stacking.

If you are registering something in a lazy way, there is no way for you 
to pass it the original implementation that you got back. Or at least, 
if you do, then you had to load the new implementation, which means 
there is no benefit to using a lazy registration.

I would tend to reject this with the statement "you cannot decorate a 
command in a lazy way". I'm willing to be persuaded, though, which is 
why I voted comment.

For details, see: 
Project: Bazaar

More information about the bazaar mailing list