diff mercurial/revset.py @ 20525:aa73a6327df4

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.
author Lucas Moscovicz <lmoscovicz@fb.com>
date Tue, 18 Feb 2014 11:38:03 -0800
parents 1850a7f5fb66
children 9ad6dae67845
line wrap: on
line diff
--- 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