Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 20728:1c8b62c0a47e
revset: added filter method to _addset
This method is intended to duck-type baseset, so we will still have _addset
as a private class but we will be able return it without wrapping it into an
orderedlazyset or a lazyset.
author | Lucas Moscovicz <lmoscovicz@fb.com> |
---|---|
date | Thu, 13 Mar 2014 19:12:36 -0700 |
parents | 1e59f760d850 |
children | caa69cb223b0 |
comparison
equal
deleted
inserted
replaced
20727:1e59f760d850 | 20728:1c8b62c0a47e |
---|---|
2390 def _list(self): | 2390 def _list(self): |
2391 if not self._genlist: | 2391 if not self._genlist: |
2392 self._genlist = baseset(self._iterator()) | 2392 self._genlist = baseset(self._iterator()) |
2393 return self._genlist | 2393 return self._genlist |
2394 | 2394 |
2395 def filter(self, condition): | |
2396 if self._ascending is not None: | |
2397 return orderedlazyset(self, condition, ascending=self._ascending) | |
2398 return lazyset(self, condition) | |
2399 | |
2395 def _iterator(self): | 2400 def _iterator(self): |
2396 """Iterate over both collections without repeating elements | 2401 """Iterate over both collections without repeating elements |
2397 | 2402 |
2398 If the ascending attribute is not set, iterate over the first one and | 2403 If the ascending attribute is not set, iterate over the first one and |
2399 then over the second one checking for membership on the first one so we | 2404 then over the second one checking for membership on the first one so we |