comparison hgext/remotefilelog/historypack.py @ 49284:d44e3c45f0e4

py3: replace `pycompat.xrange` by `range`
author Manuel Jacob <me@manueljacob.de>
date Sun, 29 May 2022 15:17:27 +0200
parents f254fc73d956
children
comparison
equal deleted inserted replaced
49283:44b26349127b 49284:d44e3c45f0e4
3 from mercurial.node import ( 3 from mercurial.node import (
4 hex, 4 hex,
5 sha1nodeconstants, 5 sha1nodeconstants,
6 ) 6 )
7 from mercurial import ( 7 from mercurial import (
8 pycompat,
9 util, 8 util,
10 ) 9 )
11 from mercurial.utils import hashutil 10 from mercurial.utils import hashutil
12 from . import ( 11 from . import (
13 basepack, 12 basepack,
205 fanout = self._fanouttable 204 fanout = self._fanouttable
206 205
207 start = fanout[fanoutkey] + params.indexstart 206 start = fanout[fanoutkey] + params.indexstart
208 indexend = self._indexend 207 indexend = self._indexend
209 208
210 for i in pycompat.xrange(fanoutkey + 1, params.fanoutcount): 209 for i in range(fanoutkey + 1, params.fanoutcount):
211 end = fanout[i] + params.indexstart 210 end = fanout[i] + params.indexstart
212 if end != start: 211 if end != start:
213 break 212 break
214 else: 213 else:
215 end = indexend 214 end = indexend
321 revcount = struct.unpack( 320 revcount = struct.unpack(
322 b'!I', data[offset : offset + ENTRYCOUNTSIZE] 321 b'!I', data[offset : offset + ENTRYCOUNTSIZE]
323 )[0] 322 )[0]
324 offset += ENTRYCOUNTSIZE 323 offset += ENTRYCOUNTSIZE
325 324
326 for i in pycompat.xrange(revcount): 325 for i in range(revcount):
327 entry = struct.unpack( 326 entry = struct.unpack(
328 PACKFORMAT, data[offset : offset + PACKENTRYLENGTH] 327 PACKFORMAT, data[offset : offset + PACKENTRYLENGTH]
329 ) 328 )
330 offset += PACKENTRYLENGTH 329 offset += PACKENTRYLENGTH
331 330