[PATCH] Re: [new] diffstat plugin
Michael Ellerman
michael at ellerman.id.au
Thu Dec 1 20:16:04 GMT 2005
On Thu, 1 Dec 2005 11:21, Wouter van Heyst wrote:
> <snip>
>
> > > It doesn't accept revision parameters: bzr ds -r5..8 fails.
> >
> > ...but after some minor hacking it does:
>
> The patch below uses a slightly different approach, bzrlib/builtins.py
> cmd_diff matches the style Wouter used, is that a recommended bzr coding
> style?
Thanks guys, I've added something similar.
> While testing if it still worked, I noticed some difference between
> external and internal diffstat:
>
> newie%~/.bazaar/plugins/diffstat> bzr diff -r -2.. | diffstat
> __init__.py | 29 --------------------
> diffstat.py | 87
> ------------------------------------------------------------ 2 files
> changed, 116 deletions(-)
> newie%~/.bazaar/plugins/diffstat> bzr ds -r -2..
> diffstat.py | 87 +-------------------------------------------
> __init__.py | 29 +--------------
> 2 files changed, 0 insertions(+), 116 deletions(-)
>
> How important is trying to achieve the exact same output?
Well for me, not very. There's at least one case I know of where diffstat
doesn't do what I want it to.
It looks like external diffstat thinks your terminal is wider than my version
does, it's probably doing something clever and working it out - I just assume
78 columns. Patches welcome ;)
Having said that, there is a bug in my version where I always print a + or -
even if there's no additions or removals (as you see above) - I've fixed it
now.
I've also changed my version to honour the order of files it gets from diff,
which I think is what diffstat does also.
cheers
--
Michael Ellerman
IBM OzLabs
email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051201/de739d9f/attachment.pgp
More information about the bazaar
mailing list