Patchwork D5604: tests: fix up uses of xrange in remotefilelog tests for py3

login
register
mail settings
Submitter phabricator
Date Jan. 16, 2019, 5:21 p.m.
Message ID <fad0b3529bae829553be6c6f560d2a1d@localhost.localdomain>
Download mbox | patch
Permalink /patch/37826/
State Not Applicable
Headers show

Comments

phabricator - Jan. 16, 2019, 5:21 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2888d12b80a6: tests: fix up uses of xrange in remotefilelog tests for py3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5604?vs=13264&id=13285

REVISION DETAIL
  https://phab.mercurial-scm.org/D5604

AFFECTED FILES
  tests/test-remotefilelog-cacheprocess.t
  tests/test-remotefilelog-datapack.py

CHANGE DETAILS




To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

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 @@ 
 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 @@ 
         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 @@ 
         ]
         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)
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):