equal
deleted
inserted
replaced
6 # This software may be used and distributed according to the terms of the |
6 # This software may be used and distributed according to the terms of the |
7 # GNU General Public License version 2 or any later version. |
7 # GNU General Public License version 2 or any later version. |
8 |
8 |
9 '''command to display statistics about repository history''' |
9 '''command to display statistics about repository history''' |
10 |
10 |
11 from __future__ import absolute_import |
11 from __future__ import absolute_import, division |
12 |
12 |
13 import datetime |
13 import datetime |
14 import os |
14 import os |
15 import time |
15 import time |
16 |
16 |
203 def format(name, count): |
203 def format(name, count): |
204 return "%s %6d %s\n" % (pad(name, maxname), sum(count), |
204 return "%s %6d %s\n" % (pad(name, maxname), sum(count), |
205 '*' * charnum(sum(count))) |
205 '*' * charnum(sum(count))) |
206 |
206 |
207 def charnum(count): |
207 def charnum(count): |
208 return int(round(count * width / maxcount)) |
208 return int(round(count * width // maxcount)) |
209 |
209 |
210 for name, count in rate: |
210 for name, count in rate: |
211 ui.write(format(name, count)) |
211 ui.write(format(name, count)) |