[PATCH 3 of 8 STABLE] debugrevlog: handle empty chains/extra

timeless timeless at mozdev.org
Mon Feb 1 01:29:14 CST 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1454273593 0
#      Sun Jan 31 20:53:13 2016 +0000
# Branch stable
# Node ID 656e33b198f29f222c54e6eb546f5ecea8928c64
# Parent  9f98a0cc6fa3c19af557766eeed16e06227ed4d1
debugrevlog: handle empty chains/extra

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2634,8 +2634,8 @@
         except IndexError:
             prevrev = -1
 
-        chainratio = float(chainsize) / float(uncomp)
-        extraratio = float(extradist) / float(chainsize)
+        chainratio = uncomp and float(chainsize) / float(uncomp)
+        extraratio = chainsize and float(extradist) / float(chainsize)
 
         fm.startitem()
         fm.write('rev chainid chainlen prevrev deltatype compsize '


More information about the Mercurial-devel mailing list