[MERGE 2/3] Towards XML log output: Refactor LogFormatter

Wouter van Heyst larstiq at larstiq.dyndns.org
Sat Nov 25 18:27:13 GMT 2006


On Fri, Nov 10, 2006 at 04:42:50PM -0600, John Arbash Meinel wrote:

...

> Aaron's comment on Bundle Buggy is:
> 
> Aaron Bentley: -0
> I'm not super enthusiastic about this, because you seem to be assuming
> that every log formatter is a derived from LogFormatter.   Duck typing
> means that's not required.   So this isn't really maintaining interface
> compatibility.
> 
> 
> I can understand his point, though I think we need to discuss it.
> 
> At some point we have to be allowed to do something like this. But maybe
> we could change the code to do:
> 
> def show_log(...):
>   log_func = getattr(lf, 'show_log', None)
>   if log_func is not None:
>     return lf.show_log(...)
> 
>   symbol_versioning.warn('Log formatters should provide a show_log'
> 			 'function as of version ...')
>   ... do it the old way ...
> 
> 
> And then for the moment, we won't change the callers, so builtins.py
> still calls bzrlib.log.show_log(lf=lf).
> 
> And then after a release or 2, we can switch to just calling
> lf.show_log() directly.
> 
> Would that work better for you Aaron?

Seems sensible to me.

Wouter van Heyst
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061125/859db53c/attachment.pgp 


More information about the bazaar mailing list