localrepo: stream_in may raise ZeroDivisionError with nul float elapsed argument.
authorPatrick Mezard <pmezard@gmail.com>
Mon, 19 Feb 2007 10:29:05 +0100
changeset 4128 43d8f7466920
parent 4127 a3a6f71edf2e
child 4129 e817c68edfed
localrepo: stream_in may raise ZeroDivisionError with nul float elapsed argument.
mercurial/localrepo.py
--- 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)))