##// END OF EJS Templates
sparse-revlog: put the native implementation of slicechunktodensity to use...
Boris Feld -
r40745:39d29542 default
parent child Browse files
Show More
@@ -44,6 +44,7 b' class _testrevlog(object):'
44 self._srdensitythreshold = density
44 self._srdensitythreshold = density
45 self._srmingapsize = mingap
45 self._srmingapsize = mingap
46 self._snapshot = set(snapshot)
46 self._snapshot = set(snapshot)
47 self.index = None
47
48
48 def start(self, rev):
49 def start(self, rev):
49 if rev == 0:
50 if rev == 0:
@@ -120,9 +121,12 b' def slicechunk(revlog, revs, targetsize='
120 targetsize = max(targetsize, revlog._srmingapsize)
121 targetsize = max(targetsize, revlog._srmingapsize)
121 # targetsize should not be specified when evaluating delta candidates:
122 # targetsize should not be specified when evaluating delta candidates:
122 # * targetsize is used to ensure we stay within specification when reading,
123 # * targetsize is used to ensure we stay within specification when reading,
123 for chunk in _slicechunktodensity(revlog, revs,
124 densityslicing = getattr(revlog.index, 'slicechunktodensity', None)
124 revlog._srdensitythreshold,
125 if densityslicing is None:
125 revlog._srmingapsize):
126 densityslicing = lambda x, y, z: _slicechunktodensity(revlog, x, y, z)
127 for chunk in densityslicing(revs,
128 revlog._srdensitythreshold,
129 revlog._srmingapsize):
126 for subchunk in _slicechunktosize(revlog, chunk, targetsize):
130 for subchunk in _slicechunktosize(revlog, chunk, targetsize):
127 yield subchunk
131 yield subchunk
128
132
General Comments 0
You need to be logged in to leave comments. Login now