167 def format(name, count): |
167 def format(name, count): |
168 return "%s %6d %s\n" % (pad(name, maxname), sum(count), |
168 return "%s %6d %s\n" % (pad(name, maxname), sum(count), |
169 '*' * charnum(sum(count))) |
169 '*' * charnum(sum(count))) |
170 |
170 |
171 def charnum(count): |
171 def charnum(count): |
172 return int(round(count*width/maxcount)) |
172 return int(round(count * width / maxcount)) |
173 |
173 |
174 for name, count in rate: |
174 for name, count in rate: |
175 ui.write(format(name, count)) |
175 ui.write(format(name, count)) |
176 |
176 |
177 |
177 |
178 cmdtable = { |
178 cmdtable = { |
179 "churn": |
179 "churn": |
180 (churn, |
180 (churn, |
181 [('r', 'rev', [], _('count rate for the specified revision or range')), |
181 [('r', 'rev', [], _('count rate for the specified revision or range')), |
182 ('d', 'date', '', _('count rate for revisions matching date spec')), |
182 ('d', 'date', '', _('count rate for revisions matching date spec')), |
183 ('t', 'template', '{author|email}', _('template to group changesets')), |
183 ('t', 'template', '{author|email}', |
|
184 _('template to group changesets')), |
184 ('f', 'dateformat', '', |
185 ('f', 'dateformat', '', |
185 _('strftime-compatible format for grouping by date')), |
186 _('strftime-compatible format for grouping by date')), |
186 ('c', 'changesets', False, _('count rate by number of changesets')), |
187 ('c', 'changesets', False, _('count rate by number of changesets')), |
187 ('s', 'sort', False, _('sort by key (default: sort by count)')), |
188 ('s', 'sort', False, _('sort by key (default: sort by count)')), |
188 ('', 'diffstat', False, _('display added/removed lines separately')), |
189 ('', 'diffstat', False, _('display added/removed lines separately')), |