[PATCH V2] debugdeltachain: display how many chunks would be read in sparse-read mode

Yuya Nishihara yuya at tcha.org
Thu Jan 18 07:21:31 EST 2018


On Wed, 17 Jan 2018 14:30:27 +0100, Paul Morelle wrote:
> # HG changeset patch
> # User Paul Morelle <paul.morelle at octobus.net>
> # Date 1508157126 -7200
> #      Mon Oct 16 14:32:06 2017 +0200
> # Node ID 77d4c2b07d6be9219a127fc00b333dca9f65b45f
> # Parent  821d8a5ab4ff890a7732c2e4cdcc7f32191e5942
> # EXP-Topic debug-sparse-read
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 77d4c2b07d6b
> debugdeltachain: display how many chunks would be read in sparse-read mode

>              readdensity = float(chainsize) / float(readsize)
>  
> -            fm.write('readsize largestblock readdensity',
> -                     ' %10d %10d %9.5f',
> -                     readsize, largestblock, readdensity,
> +            if util.safehasattr(revlog, '_slicechunk'):
> +                revchunks = tuple(revlog._slicechunk(r, chain))
> +            else:
> +                revchunks = (chain,)

Nit: hasattr() isn't necessary. revlog._slicechunk() is used in the previous
block.


More information about the Mercurial-devel mailing list