revset: changed spanset to take a repo argument
authorLucas Moscovicz <lmoscovicz@fb.com>
Tue, 18 Feb 2014 11:38:03 -0800
changeset 20525 aa73a6327df4
parent 20524 28b8ff84db3f
child 20526 9ad6dae67845
revset: changed spanset to take a repo argument This way, we can have by default the length of the repo as the end argument and less code has to be aware of hidden revisions.
mercurial/revset.py
--- a/mercurial/revset.py	Mon Feb 17 14:49:56 2014 -0600
+++ b/mercurial/revset.py	Tue Feb 18 11:38:03 2014 -0800
@@ -2166,10 +2166,13 @@
     """Duck type for baseset class which represents a range of revisions and
     can work lazily and without having all the range in memory
     """
-    def __init__(self, start, end, hiddenrevs=set()):
+    def __init__(self, repo, start=0, end=None):
         self._start = start
-        self._end = end
-        self._hiddenrevs = hiddenrevs
+        if end is not None:
+            self._end = end
+        else:
+            self._end = len(repo)
+        self._hiddenrevs = repo.changelog.filteredrevs
 
     def _contained(self, rev):
         return (rev <= self._start and rev > self._end) or (rev >= self._start