[PATCH 6 of 8 STABLE] debugrevlog: handle no chains

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


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1454273735 0
#      Sun Jan 31 20:55:35 2016 +0000
# Branch stable
# Node ID 28f17ee0e20d30d547729532164c77f1a29f9e64
# Parent  c73d43cffa2887c9f0d3e6f3572f833626a92d68
debugrevlog: handle no chains

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3326,11 +3326,12 @@
     ui.write(('    full      : ') + fmt % pcfmt(fulltotal, totalsize))
     ui.write(('    deltas    : ') + fmt % pcfmt(deltatotal, totalsize))
 
-    ui.write('\n')
-    fmt = dfmtstr(max(avgchainlen, compratio))
-    ui.write(('avg chain length  : ') + fmt % avgchainlen)
-    ui.write(('max chain length  : ') + fmt % maxchainlen)
-    ui.write(('compression ratio : ') + fmt % compratio)
+    if chainlengths:
+        ui.write('\n')
+        fmt = dfmtstr(max(avgchainlen, compratio))
+        ui.write(('avg chain length  : ') + fmt % avgchainlen)
+        ui.write(('max chain length  : ') + fmt % maxchainlen)
+        ui.write(('compression ratio : ') + fmt % compratio)
 
     if format > 0:
         ui.write('\n')


More information about the Mercurial-devel mailing list