Mercurial > hg-stable
changeset 20716:fa1ac5faa7c4
revset: added __nonzero__ method to spanset class
Implemented it in a lazy way, just look for the first non-filtered revision
and return True if there's any revision at all.
author | Lucas Moscovicz <lmoscovicz@fb.com> |
---|---|
date | Fri, 14 Mar 2014 09:07:59 -0700 |
parents | 41e1064486f9 |
children | da3124178fbb |
files | mercurial/revset.py |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revset.py Thu Mar 06 09:41:47 2014 -0800 +++ b/mercurial/revset.py Fri Mar 14 09:07:59 2014 -0700 @@ -2490,6 +2490,11 @@ return self._contained(x) and not (self._hiddenrevs and rev in self._hiddenrevs) + def __nonzero__(self): + for r in self: + return True + return False + def __and__(self, x): if isinstance(x, baseset): x = x.set()