diff hgext/churn.py @ 9557:dbe2bdd5e488

merge with i18n-stable
author Wagner Bruna <wbruna@softwareexpress.com.br>
date Tue, 08 Sep 2009 19:46:20 -0300
parents d7b6429c5ad4 f7968bba2307
children 812aaef40757
line wrap: on
line diff
--- a/hgext/churn.py	Tue Aug 18 08:49:41 2009 +0200
+++ b/hgext/churn.py	Tue Sep 08 19:46:20 2009 -0300
@@ -146,7 +146,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.0
     maxname = max([len(k) for k, v in rate])
 
     ttywidth = util.termwidth()