[PATCH 13 of 13] revset: replace remaining uses of range with xrange

Bryan O'Sullivan bos at serpentine.com
Fri Jun 1 17:52:11 CDT 2012


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1338591022 25200
# Node ID 06d29689720ea5555dafb32f174c2de7f0ada93c
# Parent  22a64d1db30274eba4fb3be82a87568b1db0b174
revset: replace remaining uses of range with xrange

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -303,9 +303,9 @@ def rangeset(repo, subset, x, y):
     m, n = m[0], n[-1]
 
     if m < n:
-        r = range(m, n + 1)
+        r = xrange(m, n + 1)
     else:
-        r = range(m, n - 1, -1)
+        r = xrange(m, n - 1, -1)
     return filterrevs(r, subset, contig=True)
 
 def dagrange(repo, subset, x, y):
@@ -391,7 +391,7 @@ def ancestorspec(repo, subset, x, n):
     ps = set()
     cl = repo.changelog
     for r in getset(repo, subset, x):
-        for i in range(n):
+        for i in xrange(n):
             r = cl.parentrevs(r)[0]
         ps.add(r)
     return [r for r in subset if r in ps]


More information about the Mercurial-devel mailing list