Mercurial > hg-git
changeset 103:b1f0ae5e0f3f
total is not always > 1
author | Scott Chacon <schacon@gmail.com> |
---|---|
date | Sun, 10 May 2009 10:52:06 -0700 |
parents | 302df8a2a8d0 |
children | 7e345078425e |
files | git_handler.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/git_handler.py Sun May 10 08:58:24 2009 -0700 +++ b/git_handler.py Sun May 10 10:52:06 2009 -0700 @@ -160,7 +160,9 @@ def export_git_objects(self): self.ui.status(_("exporting git objects\n")) total = len(self.repo.changelog) - magnitude = int(math.log(total, 10)) + 1 + magnitude = 1 + if total > 0: + magnitude = int(math.log(total, 10)) + 1 for i, rev in enumerate(self.repo.changelog): if i%100 == 0: self.ui.status(_("at: %*d/%d\n") % (magnitude, i, total))