Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
9556:6aece8fc7f3c | 9557:dbe2bdd5e488 |
---|---|
144 return | 144 return |
145 | 145 |
146 sortkey = ((not opts.get('sort')) and (lambda x: -x[1]) or None) | 146 sortkey = ((not opts.get('sort')) and (lambda x: -x[1]) or None) |
147 rate.sort(key=sortkey) | 147 rate.sort(key=sortkey) |
148 | 148 |
149 maxcount = float(max([v for k, v in rate])) | 149 # Be careful not to have a zero maxcount (issue833) |
150 maxcount = float(max([v for k, v in rate])) or 1.0 | |
150 maxname = max([len(k) for k, v in rate]) | 151 maxname = max([len(k) for k, v in rate]) |
151 | 152 |
152 ttywidth = util.termwidth() | 153 ttywidth = util.termwidth() |
153 ui.debug(_("assuming %i character terminal\n") % ttywidth) | 154 ui.debug(_("assuming %i character terminal\n") % ttywidth) |
154 width = ttywidth - maxname - 2 - 6 - 2 - 2 | 155 width = ttywidth - maxname - 2 - 6 - 2 - 2 |