Mercurial > hg > mercurial-source
diff 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 (2014-03-14) |
parents | 1e59f760d850 |
children | caa69cb223b0 |
line wrap: on
line diff
--- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2392,6 +2392,11 @@ self._genlist = baseset(self._iterator()) return self._genlist + def filter(self, condition): + if self._ascending is not None: + return orderedlazyset(self, condition, ascending=self._ascending) + return lazyset(self, condition) + def _iterator(self): """Iterate over both collections without repeating elements