diff mercurial/cmdutil.py @ 38783:e7aa113b14f7

global: use pycompat.xrange() On Python 3, our module importer automatically rewrites xrange() to pycompat.xrange(). We want to move away from the custom importer on Python 3. This commit converts all instances of xrange() to use pycompat.xrange(). Differential Revision: https://phab.mercurial-scm.org/D4032
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 01 Aug 2018 13:00:45 -0700
parents e252f136b948
children 32ece991955c
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Aug 01 12:57:15 2018 -0700
+++ b/mercurial/cmdutil.py	Wed Aug 01 13:00:45 2018 -0700
@@ -1755,7 +1755,7 @@
         """
         cl_count = len(repo)
         revs = []
-        for j in xrange(0, last + 1):
+        for j in pycompat.xrange(0, last + 1):
             linkrev = filelog.linkrev(j)
             if linkrev < minrev:
                 continue
@@ -1966,7 +1966,7 @@
         rev = repo[rev].rev()
         ff = _followfilter(repo)
         stop = min(revs[0], revs[-1])
-        for x in xrange(rev, stop - 1, -1):
+        for x in pycompat.xrange(rev, stop - 1, -1):
             if ff.match(x):
                 wanted = wanted - [x]
 
@@ -1985,7 +1985,7 @@
         stopiteration = False
         for windowsize in increasingwindows():
             nrevs = []
-            for i in xrange(windowsize):
+            for i in pycompat.xrange(windowsize):
                 rev = next(it, None)
                 if rev is None:
                     stopiteration = True