status command and output styles

Martin Pool mbp at canonical.com
Thu Feb 25 06:33:39 GMT 2010


On 24 February 2010 09:51, arnaud jeansen <arnaud.jeansen at gmail.com> wrote:
> Good evening,
>
> I have been reading this list (and using Bazaar) for some time, but this is
> my first email to the list. Please be gentle :)
>
> I have been looking at implementing alternate outputs for the bzr status
> command. This was triggered by jealousy after looking at some outputs coming
> out of projects using git  (e.g.list of files changed with their number of
> modified lines, percentage of lines changed across directories, etc... the
> kernel mailing list is full of it)
>
> I set out to write my first (lousy) plugin to try to scratch my itch... and
> ended up stuck 10 minutes ago, with way too much code duplicated  in my
> _init.py :(
>
> From what I understand now, all the display logic for 'status' is contained
> within the TreeDelta class (with a 'short' knob to switch between the two
> available output types). This makes it very difficult to provide other
> output types from within bzr, let alone from a plugin.
>
> Would it make sense to abstract out the output formatting for status ? I
> imagine it could be possible to create a new class (OutputFormat,
> OutputTemplate, whatever) and
> - pass the OutputFormat in a TreeDelta.show() (visitor pattern),
> - or move the show() logic to OutputFormat and have it wrap a TreeDelta,
> - or something else

Yes, it would be good to abstract it more.  Ian and Vincent have
recently done some things here and could probably mentor you.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list