changeset 28059:740208f6f6af

debugrevlog: fix dumping manifest fails on empty first revision (issue5062)
author liscju <piotr.listkiewicz@gmail.com>
date Wed, 10 Feb 2016 21:01:52 +0100
parents ff6e8dc659f8
children 726f8d6cc324
files mercurial/commands.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Feb 10 01:48:58 2016 -0800
+++ b/mercurial/commands.py	Wed Feb 10 21:01:52 2016 +0100
@@ -3216,12 +3216,16 @@
             ts = ts + rs
             heads -= set(r.parentrevs(rev))
             heads.add(rev)
+            try:
+                compression = ts / r.end(rev)
+            except ZeroDivisionError:
+                compression = 0
             ui.write("%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d "
                      "%11d %5d %8d\n" %
                      (rev, p1, p2, r.start(rev), r.end(rev),
                       r.start(dbase), r.start(cbase),
                       r.start(p1), r.start(p2),
-                      rs, ts, ts / r.end(rev), len(heads), clen))
+                      rs, ts, compression, len(heads), clen))
         return 0
 
     v = r.version