Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 22508:2434c68d82a8
revert: add a fullreposet class
Every revset evaluation starts from `subset = spanset(repo)` and a lot of
revset predicates build a `spansetrepo` for their internal needs.
`spanset` is a generic class that can handle any situation. As a result a lot
of operation between spanset result in an `orderedlazyset`, a safe object but
suboptimal in may situation.
So we introduce a `fullreposet` class where some of the operation will be
overwritten to produce more interesting results.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 29 Apr 2014 19:06:15 -0700 |
parents | c425b22a7ca5 |
children | fbae659543cf |
comparison
equal
deleted
inserted
replaced
22507:5c00c5298f98 | 22508:2434c68d82a8 |
---|---|
2849 return self._start >= self._end | 2849 return self._start >= self._end |
2850 | 2850 |
2851 def filter(self, l): | 2851 def filter(self, l): |
2852 return orderedlazyset(self, l, ascending=self.isascending()) | 2852 return orderedlazyset(self, l, ascending=self.isascending()) |
2853 | 2853 |
2854 class fullreposet(spanset): | |
2855 """a set containing all revisions in the repo | |
2856 | |
2857 This class exists to host special optimisation. | |
2858 """ | |
2859 | |
2860 def __init__(self, repo): | |
2861 super(fullreposet, self).__init__(repo) | |
2862 | |
2854 # tell hggettext to extract docstrings from these functions: | 2863 # tell hggettext to extract docstrings from these functions: |
2855 i18nfunctions = symbols.values() | 2864 i18nfunctions = symbols.values() |