##// END OF EJS Templates
revlog: _segmentspan computes the byte span of a segment...
Paul Morelle -
r38655:25534e0c default
parent child Browse files
Show More
@@ -210,6 +210,15 b' def _trimchunk(revlog, revs, startidx, e'
210
210
211 return revs[startidx:endidx]
211 return revs[startidx:endidx]
212
212
213 def _segmentspan(revlog, revs):
214 """Get the byte span of a segment of revisions
215
216 revs is a sorted array of revision numbers
217 """
218 if not revs:
219 return 0
220 return revlog.end(revs[-1]) - revlog.start(revs[0])
221
213 def _slicechunk(revlog, revs):
222 def _slicechunk(revlog, revs):
214 """slice revs to reduce the amount of unrelated data to be read from disk.
223 """slice revs to reduce the amount of unrelated data to be read from disk.
215
224
@@ -223,9 +232,7 b' def _slicechunk(revlog, revs):'
223 yield revs
232 yield revs
224 return
233 return
225
234
226 startbyte = start(revs[0])
235 readdata = deltachainspan = _segmentspan(revlog, revs)
227 endbyte = start(revs[-1]) + length(revs[-1])
228 readdata = deltachainspan = endbyte - startbyte
229
236
230 if deltachainspan < revlog._srmingapsize:
237 if deltachainspan < revlog._srmingapsize:
231 yield revs
238 yield revs
General Comments 0
You need to be logged in to leave comments. Login now