# HG changeset patch # User Sverre Rabbelier # Date 1241978652 25200 # Node ID 8c83d2021b030c95788c4229816fd9fdec2f2caf # Parent 3aa2f6caed166f56f712ef9a9aed819d9371515c more pythonic way to calculate the magnitude diff -r 3aa2f6caed16 -r 8c83d2021b03 git_handler.py --- a/git_handler.py Sun May 10 10:42:44 2009 -0700 +++ b/git_handler.py Sun May 10 11:04:12 2009 -0700 @@ -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))