Latest bzr crashes with plugins command
John Arbash Meinel
john at arbash-meinel.com
Wed Jan 30 14:55:23 GMT 2008
Aaron Bentley wrote:
> Alexander Belchenko wrote:
>> Guillermo Gonzalez ?8H5B:
>>> On Jan 29, 2008 10:10 PM, Aaron Bentley <aaron at aaronbentley.com> wrote:
>>>> So it's not really plausible to get this message from a pristine bzr.
>>>>
>>>> However, I note you've got the xmloutput plugin installed, and that
>>>> provides a plugins command.
>>>>
>>>> If I install xmloutput, I get the same results as you. So I believe
>>>> bzr-xmloutput is broken, not Bazaar.
>>>>
>>> Hi,
>>> Aaron is right (thanks), it's the xmloutput plugin. (sorry!)
>>> I just fixed it in trunk. A new tarball soon :)
>> I recommend you using **kwargs for all commands your plugin overrides.
>> And when you're run underlying bzr command just pass this **kwargs
>> to it run() method. Something like this:
>
> In the general case, it's good to propagate *args, too. But commands in
> particular are rarely invoked with positional parameters.
>
> Aaron
The bzrlib command line parser (which is the most common way these are
invoked) indeed only uses kwargs. I guess there are some plugins, that
call directly into the cmd_foo.run(). I always felt that it was just
exposing that there was too much code in the Command class. But
certainly doing:
def run(self, *args, **kwargs):
other.run(*args, **kwargs)
Is the right way to do it.
John
=:->
More information about the bazaar
mailing list