Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 22740:f40a57e8fda1
generatorset: promote to smartset
This is not going to be efficient but we need all basic set classes to be smartsets
for the other classes to work.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 03 Oct 2014 01:55:09 -0500 |
parents | 4ed47a1b2d24 |
children | ef2c1ea8fb2c |
comparison
equal
deleted
inserted
replaced
22739:4ed47a1b2d24 | 22740:f40a57e8fda1 |
---|---|
2719 def reverse(self): | 2719 def reverse(self): |
2720 self._list.reverse() | 2720 self._list.reverse() |
2721 if self._ascending is not None: | 2721 if self._ascending is not None: |
2722 self._ascending = not self._ascending | 2722 self._ascending = not self._ascending |
2723 | 2723 |
2724 class _generatorset(object): | 2724 class _generatorset(abstractsmartset): |
2725 """Wrap a generator for lazy iteration | 2725 """Wrap a generator for lazy iteration |
2726 | 2726 |
2727 Wrapper structure for generators that provides lazy membership and can | 2727 Wrapper structure for generators that provides lazy membership and can |
2728 be iterated more than once. | 2728 be iterated more than once. |
2729 When asked for membership it generates values until either it finds the | 2729 When asked for membership it generates values until either it finds the |