comparison mercurial/debugcommands.py @ 39330:655b5b465953

revlog: split functionality related to deltas computation in a new module The revlog module is getting big and this logic is getting more and more advanced. Moving it to `mercurial.revlogutils.deltas` split a lot off revlog.py and will help this logic to become less interleaved with revlog. The code is simply moved without modification (but for namespace changes). Refactoring and improvement will be made in later changesets.
author Boris Feld <boris.feld@octobus.net>
date Thu, 16 Aug 2018 02:53:42 +0200
parents 828a45233036
children 0f549da54379
comparison
equal deleted inserted replaced
39329:729082bb9938 39330:655b5b465953
86 dateutil, 86 dateutil,
87 procutil, 87 procutil,
88 stringutil, 88 stringutil,
89 ) 89 )
90 90
91 from .revlogutils import (
92 deltas as deltautil
93 )
94
91 release = lockmod.release 95 release = lockmod.release
92 96
93 command = registrar.command() 97 command = registrar.command()
94 98
95 @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True) 99 @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True)
704 if withsparseread: 708 if withsparseread:
705 readsize = 0 709 readsize = 0
706 largestblock = 0 710 largestblock = 0
707 srchunks = 0 711 srchunks = 0
708 712
709 for revschunk in revlog._slicechunk(r, chain): 713 for revschunk in deltautil.slicechunk(r, chain):
710 srchunks += 1 714 srchunks += 1
711 blkend = start(revschunk[-1]) + length(revschunk[-1]) 715 blkend = start(revschunk[-1]) + length(revschunk[-1])
712 blksize = blkend - start(revschunk[0]) 716 blksize = blkend - start(revschunk[0])
713 717
714 readsize += blksize 718 readsize += blksize