comparison hgext/churn.py @ 9389:7cca980317c5

merge with crew-stable
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 26 Aug 2009 13:05:51 +0200
parents 1ef630452e0b f7968bba2307
children 637f2726ec7f
comparison
equal deleted inserted replaced
9387:20ed9909dbd9 9389:7cca980317c5
146 return 146 return
147 147
148 sortkey = ((not opts.get('sort')) and (lambda x: -x[1]) or None) 148 sortkey = ((not opts.get('sort')) and (lambda x: -x[1]) or None)
149 rate.sort(key=sortkey) 149 rate.sort(key=sortkey)
150 150
151 maxcount = float(max([v for k, v in rate])) 151 # Be careful not to have a zero maxcount (issue833)
152 maxcount = float(max([v for k, v in rate])) or 1.0
152 maxname = max([len(k) for k, v in rate]) 153 maxname = max([len(k) for k, v in rate])
153 154
154 ttywidth = util.termwidth() 155 ttywidth = util.termwidth()
155 ui.debug(_("assuming %i character terminal\n") % ttywidth) 156 ui.debug(_("assuming %i character terminal\n") % ttywidth)
156 width = ttywidth - maxname - 2 - 6 - 2 - 2 157 width = ttywidth - maxname - 2 - 6 - 2 - 2