--- a/mercurial/debugcommands.py Mon Jul 09 15:33:49 2018 -0700
+++ b/mercurial/debugcommands.py Thu Jun 21 18:19:57 2018 +0200
@@ -678,8 +678,15 @@
except IndexError:
prevrev = -1
- chainratio = float(chainsize) / float(uncomp)
- extraratio = float(extradist) / float(chainsize)
+ if uncomp != 0:
+ chainratio = float(chainsize) / float(uncomp)
+ else:
+ chainratio = chainsize
+
+ if chainsize != 0:
+ extraratio = float(extradist) / float(chainsize)
+ else:
+ extraratio = extradist
fm.startitem()
fm.write('rev chainid chainlen prevrev deltatype compsize '