Show More
@@ -46,7 +46,7 b' def _revancestors(repo, revs, followfirs' | |||||
46 | if parent != node.nullrev: |
|
46 | if parent != node.nullrev: | |
47 | heapq.heappush(h, -parent) |
|
47 | heapq.heappush(h, -parent) | |
48 |
|
48 | |||
49 |
return |
|
49 | return generatorset(iterate(), iterasc=False) | |
50 |
|
50 | |||
51 | def _revdescendants(repo, revs, followfirst): |
|
51 | def _revdescendants(repo, revs, followfirst): | |
52 | """Like revlog.descendants() but supports followfirst.""" |
|
52 | """Like revlog.descendants() but supports followfirst.""" | |
@@ -70,7 +70,7 b' def _revdescendants(repo, revs, followfi' | |||||
70 | yield i |
|
70 | yield i | |
71 | break |
|
71 | break | |
72 |
|
72 | |||
73 |
return |
|
73 | return generatorset(iterate(), iterasc=True) | |
74 |
|
74 | |||
75 | def _revsbetween(repo, roots, heads): |
|
75 | def _revsbetween(repo, roots, heads): | |
76 | """Return all paths between roots and heads, inclusive of both endpoint |
|
76 | """Return all paths between roots and heads, inclusive of both endpoint | |
@@ -2513,7 +2513,7 b' class addset(abstractsmartset):' | |||||
2513 | iter1 = iter(self._r1) |
|
2513 | iter1 = iter(self._r1) | |
2514 | iter2 = iter(self._r2) |
|
2514 | iter2 = iter(self._r2) | |
2515 | gen = self._iterordered(self._ascending, iter1, iter2) |
|
2515 | gen = self._iterordered(self._ascending, iter1, iter2) | |
2516 |
self._iter = |
|
2516 | self._iter = generatorset(gen) | |
2517 | return self._iter |
|
2517 | return self._iter | |
2518 |
|
2518 | |||
2519 | def __iter__(self): |
|
2519 | def __iter__(self): | |
@@ -2608,7 +2608,7 b' class addset(abstractsmartset):' | |||||
2608 | if self._ascending is not None: |
|
2608 | if self._ascending is not None: | |
2609 | self._ascending = not self._ascending |
|
2609 | self._ascending = not self._ascending | |
2610 |
|
2610 | |||
2611 |
class |
|
2611 | class generatorset(abstractsmartset): | |
2612 | """Wrap a generator for lazy iteration |
|
2612 | """Wrap a generator for lazy iteration | |
2613 |
|
2613 | |||
2614 | Wrapper structure for generators that provides lazy membership and can |
|
2614 | Wrapper structure for generators that provides lazy membership and can | |
@@ -2851,7 +2851,7 b' class fullreposet(_spanset):' | |||||
2851 | # object. |
|
2851 | # object. | |
2852 | other = baseset(other - self._hiddenrevs) |
|
2852 | other = baseset(other - self._hiddenrevs) | |
2853 | elif not util.safehasattr(other, 'ascending'): |
|
2853 | elif not util.safehasattr(other, 'ascending'): | |
2854 |
# "other" is |
|
2854 | # "other" is generatorset not a real smart set | |
2855 | # we fallback to the old way (sad kitten) |
|
2855 | # we fallback to the old way (sad kitten) | |
2856 | return super(fullreposet, self).__and__(other) |
|
2856 | return super(fullreposet, self).__and__(other) | |
2857 |
|
2857 |
General Comments 0
You need to be logged in to leave comments.
Login now