mercurial/debugcommands.py
changeset 35728 22a877215ea1
parent 35678 43154a76f392
child 35730 05d415790761
--- a/mercurial/debugcommands.py	Fri Jan 19 14:10:18 2018 +0530
+++ b/mercurial/debugcommands.py	Fri Jan 19 08:35:22 2018 +0100
@@ -684,7 +684,10 @@
         if withsparseread:
             readsize = 0
             largestblock = 0
+            srchunks = 0
+
             for revschunk in revlog._slicechunk(r, chain):
+                srchunks += 1
                 blkend = start(revschunk[-1]) + length(revschunk[-1])
                 blksize = blkend - start(revschunk[0])
 
@@ -694,12 +697,6 @@
 
             readdensity = float(chainsize) / float(readsize)
 
-            if util.safehasattr(revlog, '_slicechunk'):
-                revchunks = tuple(revlog._slicechunk(r, chain))
-            else:
-                revchunks = (chain,)
-            srchunks = len(revchunks)
-
             fm.write('readsize largestblock readdensity srchunks',
                      ' %10d %10d %9.5f %8d',
                      readsize, largestblock, readdensity, srchunks,