changeset 4737:46c990705a96

py3: replace xrange() by range()
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 11 Jul 2019 14:16:48 -0700
parents 9e0d35d2f7d4
children 45508676ed00
files hgext3rd/evolve/stablerange.py hgext3rd/evolve/stablesort.py hgext3rd/pullbundle.py
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/stablerange.py	Thu Jul 11 12:19:49 2019 -0700
+++ b/hgext3rd/evolve/stablerange.py	Thu Jul 11 14:16:48 2019 -0700
@@ -502,7 +502,7 @@
             elif skips < size:
                 revs = walkfrom(jumphead)
                 next(revs)
-                for i in xrange(skips):
+                for i in range(skips):
                     jumphead = next(revs)
                     assert jumphead is not None
                 skipped = skips
--- a/hgext3rd/evolve/stablesort.py	Thu Jul 11 12:19:49 2019 -0700
+++ b/hgext3rd/evolve/stablesort.py	Thu Jul 11 14:16:48 2019 -0700
@@ -434,7 +434,7 @@
 
         def popready(stack):
             """pop the top most ready item in the list"""
-            for idx in xrange(len(stack) - 1, -1, -1):
+            for idx in range(len(stack) - 1, -1, -1):
                 if children[stack[idx]].issubset(seen):
                     return stack.pop(idx)
             return None
@@ -549,7 +549,7 @@
         # merge revision
 
         def jumps():
-            for idx in xrange(index[rev - 1], index[rev]):
+            for idx in range(index[rev - 1], index[rev]):
                 i = idx * 3
                 yield tuple(data[i:i + 3])
         return jumps()
--- a/hgext3rd/pullbundle.py	Thu Jul 11 12:19:49 2019 -0700
+++ b/hgext3rd/pullbundle.py	Thu Jul 11 14:16:48 2019 -0700
@@ -507,7 +507,7 @@
                   % (count, len(actionrevs)))
     if 1 < min_cache:
         repo.ui.write("  not caching ranges smaller than %d changesets\n" % min_cache)
-    for i in xrange(count):
+    for i in range(count):
         repo.ui.progress('gathering data', i, total=count)
         outgoing = takeonesample(repo, actionrevs)
         ranges = sliceoutgoing(repo, outgoing)