hgext/churn.py
changeset 9388 f7968bba2307
parent 8934 9dda4c73fc3b
child 9389 7cca980317c5
child 9557 dbe2bdd5e488
--- a/hgext/churn.py	Sun Aug 23 11:32:44 2009 +0200
+++ b/hgext/churn.py	Mon Aug 24 12:47:44 2009 +0200
@@ -146,7 +146,8 @@
     sortfn = ((not opts.get('sort')) and (lambda a, b: cmp(b[1], a[1])) or None)
     rate.sort(sortfn)
 
-    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()