changeset 4128:43d8f7466920

localrepo: stream_in may raise ZeroDivisionError with nul float elapsed argument.
author Patrick Mezard <pmezard@gmail.com>
date Mon, 19 Feb 2007 10:29:05 +0100
parents a3a6f71edf2e
children e817c68edfed
files mercurial/localrepo.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Feb 19 09:59:37 2007 +0100
+++ b/mercurial/localrepo.py	Mon Feb 19 10:29:05 2007 +0100
@@ -1949,6 +1949,8 @@
                 ofp.write(chunk)
             ofp.close()
         elapsed = time.time() - start
+        if elapsed <= 0:
+            elapsed = 0.001
         self.ui.status(_('transferred %s in %.1f seconds (%s/sec)\n') %
                        (util.bytecount(total_bytes), elapsed,
                         util.bytecount(total_bytes / elapsed)))