py3: replace xrange() by range()
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 11 Jul 2019 14:16:48 -0700
changeset 4737 46c990705a96
parent 4736 9e0d35d2f7d4
child 4738 45508676ed00
py3: replace xrange() by range()
hgext3rd/evolve/stablerange.py
hgext3rd/evolve/stablesort.py
hgext3rd/pullbundle.py
--- 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)