clfilter: remove usage of `range` and `xrange` in scmutil.revrange
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 20 Nov 2012 19:05:46 +0100
changeset 17992 c95210b82c0e
parent 17991 d605a82cf189
child 17993 1a6f8820eb71
clfilter: remove usage of `range` and `xrange` in scmutil.revrange For changelog level filtering to take effect it need to be used for any iteration. This changeset removes usage of `range` and `xrange` that survived the first pass.
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Mon Nov 12 14:05:39 2012 -0800
+++ b/mercurial/scmutil.py	Tue Nov 20 19:05:46 2012 +0100
@@ -634,13 +634,13 @@
                 start, end = spec.split(_revrangesep, 1)
                 start = revfix(repo, start, 0)
                 end = revfix(repo, end, len(repo) - 1)
-                step = start > end and -1 or 1
+                rangeiter = repo.changelog.revs(start, end)
                 if not seen and not l:
                     # by far the most common case: revs = ["-1:0"]
-                    l = range(start, end + step, step)
+                    l = list(rangeiter)
                     # defer syncing seen until next iteration
                     continue
-                newrevs = set(xrange(start, end + step, step))
+                newrevs = set(rangeiter)
                 if seen:
                     newrevs.difference_update(seen)
                     seen.update(newrevs)