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

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 1, 2016, 7:29 a.m.
Message ID <656e33b198f29f222c54.1454311754@waste.org>
Download mbox | patch
Permalink /patch/12916/
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 1454273593 0
#      Sun Jan 31 20:53:13 2016 +0000
# Branch stable
# Node ID 656e33b198f29f222c54e6eb546f5ecea8928c64
# Parent  9f98a0cc6fa3c19af557766eeed16e06227ed4d1
debugrevlog: handle empty chains/extra
Pierre-Yves David - Feb. 1, 2016, 12:19 p.m.
On 02/01/2016 07:29 AM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@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

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