# HG changeset patch # User Lucas Moscovicz # Date 2014-02-18 19:38:03 # Node ID aa73a6327df46ab2c0a9747101f971ff1afe901a # Parent 28b8ff84db3f94abef30df6f9cbbf0027a1bd8c7 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. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2166,10 +2166,13 @@ class spanset(object): """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