[PATCH] color: add support for churn --diffstat

Martin Geisler mg at lazybytes.net
Wed Dec 2 10:45:37 CST 2009


Alexander Solovyov <piranha at piranha.org.ua> writes:

> # HG changeset patch
> # User Alexander Solovyov <piranha at piranha.org.ua>
> # Date 1259615421 -7200
> # Node ID 19de3e48608e5367d91136e8627c525018e38edd
> # Parent  ad44e1f8b3f3fa2f0728deb55623ad444a753ed5
> color: add support for churn --diffstat
>
> diff --git a/hgext/color.py b/hgext/color.py
> --- a/hgext/color.py
> +++ b/hgext/color.py
> @@ -213,6 +213,16 @@ def colordiff(orig, ui, repo, *pats, **o
>      finally:
>          ui.write = oldwrite
>  
> +def colorchurn(orig, ui, repo, *pats, **opts):
> +    '''run the churn command with colored output'''
> +    if not opts.get('diffstat'):
> +        return orig(ui, repo, *pats, **opts)
> +    oldwrite = extensions.wrapfunction(ui, 'write', colordiffstat)

Ehm, I like the idea, but this does not seem to do anything :-)

The colordiffstat function adds color to '+' and '-' characters and
churn uses '*'s instead.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


More information about the Mercurial-devel mailing list