# HG changeset patch # User Augie Fackler # Date 2019-01-16 15:59:32 # Node ID 2888d12b80a602d608e0d0ae233c70a03c7a65b4 # Parent 29996f6c2687f5741a5f183d27270fec6d07bcd2 tests: fix up uses of xrange in remotefilelog tests for py3 Differential Revision: https://phab.mercurial-scm.org/D5604 diff --git a/tests/test-remotefilelog-cacheprocess.t b/tests/test-remotefilelog-cacheprocess.t --- a/tests/test-remotefilelog-cacheprocess.t +++ b/tests/test-remotefilelog-cacheprocess.t @@ -18,6 +18,8 @@ > import os > import shutil > import sys + > if sys.version_info[0] > 2: + > xrange = range > f = open('$TESTTMP/cachelog.log', 'w') > srccache = os.path.join('$TESTTMP', 'oldhgcache') > def log(message): diff --git a/tests/test-remotefilelog-datapack.py b/tests/test-remotefilelog-datapack.py --- a/tests/test-remotefilelog-datapack.py +++ b/tests/test-remotefilelog-datapack.py @@ -18,6 +18,7 @@ import silenttestrunner sys.path[0:0] = [os.path.join(os.path.dirname(__file__), '..')] from mercurial.node import nullid from mercurial import ( + pycompat, ui as uimod, ) from hgext.remotefilelog import ( @@ -245,7 +246,7 @@ class datapacktestsbase(object): revisions = [] blobs = {} total = basepack.SMALLFANOUTCUTOFF + 1 - for i in xrange(total): + for i in pycompat.xrange(total): filename = "filename-%s" % i content = filename node = self.getHash(content) @@ -328,7 +329,7 @@ class datapacktestsbase(object): ] for packsize in packsizes: revisions = [] - for i in xrange(packsize): + for i in pycompat.xrange(packsize): filename = "filename-%s" % i content = "content-%s" % i node = self.getHash(content)