comparison tests/test-remotefilelog-datapack.py @ 41254:2888d12b80a6

tests: fix up uses of xrange in remotefilelog tests for py3 Differential Revision: https://phab.mercurial-scm.org/D5604
author Augie Fackler <augie@google.com>
date Wed, 16 Jan 2019 10:59:32 -0500
parents 10c10da14c5d
children 878084a495ef
comparison
equal deleted inserted replaced
41253:29996f6c2687 41254:2888d12b80a6
16 16
17 # Load the local remotefilelog, not the system one 17 # Load the local remotefilelog, not the system one
18 sys.path[0:0] = [os.path.join(os.path.dirname(__file__), '..')] 18 sys.path[0:0] = [os.path.join(os.path.dirname(__file__), '..')]
19 from mercurial.node import nullid 19 from mercurial.node import nullid
20 from mercurial import ( 20 from mercurial import (
21 pycompat,
21 ui as uimod, 22 ui as uimod,
22 ) 23 )
23 from hgext.remotefilelog import ( 24 from hgext.remotefilelog import (
24 basepack, 25 basepack,
25 constants, 26 constants,
243 """Test creating and reading from a large pack with over X entries. 244 """Test creating and reading from a large pack with over X entries.
244 This causes it to use a 2^16 fanout table instead.""" 245 This causes it to use a 2^16 fanout table instead."""
245 revisions = [] 246 revisions = []
246 blobs = {} 247 blobs = {}
247 total = basepack.SMALLFANOUTCUTOFF + 1 248 total = basepack.SMALLFANOUTCUTOFF + 1
248 for i in xrange(total): 249 for i in pycompat.xrange(total):
249 filename = "filename-%s" % i 250 filename = "filename-%s" % i
250 content = filename 251 content = filename
251 node = self.getHash(content) 252 node = self.getHash(content)
252 blobs[(filename, node)] = content 253 blobs[(filename, node)] = content
253 revisions.append((filename, node, nullid, content)) 254 revisions.append((filename, node, nullid, content))
326 100000, 327 100000,
327 1000000, 328 1000000,
328 ] 329 ]
329 for packsize in packsizes: 330 for packsize in packsizes:
330 revisions = [] 331 revisions = []
331 for i in xrange(packsize): 332 for i in pycompat.xrange(packsize):
332 filename = "filename-%s" % i 333 filename = "filename-%s" % i
333 content = "content-%s" % i 334 content = "content-%s" % i
334 node = self.getHash(content) 335 node = self.getHash(content)
335 revisions.append((filename, node, nullid, content)) 336 revisions.append((filename, node, nullid, content))
336 337