Mercurial > hg
diff mercurial/debugcommands.py @ 38647:0f4c2c70e26e
debugdeltachain: protect against 0 readsize
If you don't read any data, read density should be 1.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 11 Jul 2018 13:48:44 +0200 |
parents | 93313f66b69b |
children | 6b5ca1d0aa1e |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Thu Jun 21 18:19:57 2018 +0200 +++ b/mercurial/debugcommands.py Wed Jul 11 13:48:44 2018 +0200 @@ -715,7 +715,10 @@ if largestblock < blksize: largestblock = blksize - readdensity = float(chainsize) / float(readsize) + if readsize: + readdensity = float(chainsize) / float(readsize) + else: + readdensity = 1 fm.write('readsize largestblock readdensity srchunks', ' %10d %10d %9.5f %8d',