builtins: self.outf.write vs trace.note
Martin Pool
mbp at canonical.com
Fri Nov 13 01:56:25 GMT 2009
2009/11/13 Aaron Bentley <aaron at aaronbentley.com>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Gordon Tyler wrote:
>> So in the process of fixing bug #271790, I noticed that most of the
>> other builtin commands use self.outf.write instead of trace.note (or an
>> appropriate trace function). I was wondering if this is intentional or
>> should I fix them to use trace.note?
>
> trace.note and self.outf.write are both appropriate, depending on
> context. Output about the process of executing the command, e.g. "using
> saved branch location" should be written using trace.note, and where
> it's not, patches are welcome. Output which is the primary
> functionality of a command, such as the output of "bzr diff" should be
> written using self.outf, and this should not be changed.
I would like to move self.outf, because I think it's only weakly
related to the specific Command object instance. We would still have
an object that knew about encoding etc. But for now, the distinction
is as Aaron says.
--
Martin <http://launchpad.net/~mbp/>
More information about the bazaar
mailing list