Mercurial > hg > hg-git
diff git_handler.py @ 107:8c83d2021b03
more pythonic way to calculate the magnitude
author | Sverre Rabbelier <sverre@rabbelier.nl> |
---|---|
date | Sun, 10 May 2009 11:04:12 -0700 (2009-05-10) |
parents | 3aa2f6caed16 |
children | 8fffec9ec750 |
line wrap: on
line diff
--- a/git_handler.py +++ b/git_handler.py @@ -161,9 +161,7 @@ def export_git_objects(self): self.ui.status(_("exporting git objects\n")) total = len(self.repo.changelog) - magnitude = 1 - if total > 0: - magnitude = int(math.log(total, 10)) + 1 + magnitude = int(math.log(total, 10)) + 1 if total else 1 for i, rev in enumerate(self.repo.changelog): if i%100 == 0: self.ui.status(_("at: %*d/%d\n") % (magnitude, i, total))