Patchwork [6,of,8,STABLE] debugrevlog: handle no chains

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 1, 2016, 7:29 a.m.
Message ID <28f17ee0e20d30d54772.1454311757@waste.org>
Download mbox | patch
Permalink /patch/12919/
State Changes Requested
Headers show

Comments

timeless@mozdev.org - Feb. 1, 2016, 7:29 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1454273735 0
#      Sun Jan 31 20:55:35 2016 +0000
# Branch stable
# Node ID 28f17ee0e20d30d547729532164c77f1a29f9e64
# Parent  c73d43cffa2887c9f0d3e6f3572f833626a92d68
debugrevlog: handle no chains
Pierre-Yves David - Feb. 1, 2016, 12:20 p.m.
On 02/01/2016 07:29 AM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1454273735 0
> #      Sun Jan 31 20:55:35 2016 +0000
> # Branch stable
> # Node ID 28f17ee0e20d30d547729532164c77f1a29f9e64
> # Parent  c73d43cffa2887c9f0d3e6f3572f833626a92d68
> debugrevlog: handle no chains

Why don't we get a test change with this fix?

Patch

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')