[PATCH] churn: issue833 was reintroduced in 9bc46d069a76, correct it and add a test

Dirkjan Ochtman dirkjan at ochtman.nl
Mon Aug 24 06:48:14 CDT 2009


On Mon, Aug 24, 2009 at 13:41, Nicolas Dumazet<nicdumz at gmail.com> wrote:
> # HG changeset patch
> # User Nicolas Dumazet <nicdumz.commits at gmail.com>
> # Date 1251110864 -7200
> # Node ID 27aea279ff6ad71ab9388e86d5fba08e384fc4c9
> # Parent  9a1a497b8c4d9b90a92d5467e6387efc44b57f4b
> churn: issue833 was reintroduced in 9bc46d069a76, correct it and add a test
>
> diff --git a/hgext/churn.py b/hgext/churn.py
> --- a/hgext/churn.py
> +++ b/hgext/churn.py
> @@ -148,7 +148,8 @@
>     sortkey = ((not opts.get('sort')) and (lambda x: -x[1]) or None)
>     rate.sort(key=sortkey)
>
> -    maxcount = float(max([v for k, v in rate]))
> +    # Be careful not to have a zero maxcount (issue833)
> +    maxcount = float(max([v for k, v in rate])) or 1.

We may use genexps now. ;)

Cheers,

Dirkjan



More information about the Mercurial-devel mailing list