# HG changeset patch # User Pierre-Yves David # Date 1412319417 18000 # Node ID 4ed47a1b2d24899dd7f61ab31a6dd58637faf6cf # Parent 70a0664008ea2dc485f2222cc3b7c5625c8751f4 generatorset: implement __nonzero__ This is necessary to become a real smartset. diff -r 70a0664008ea -r 4ed47a1b2d24 mercurial/revset.py --- a/mercurial/revset.py Fri Oct 03 00:31:33 2014 -0500 +++ b/mercurial/revset.py Fri Oct 03 01:56:57 2014 -0500 @@ -2741,6 +2741,11 @@ self._genlist = baseset([]) self._finished = False + def __nonzero__(self): + for r in self: + return True + return False + def __contains__(self, x): if x in self._cache: return self._cache[x]