Comments
Patch
@@ -244,10 +244,18 @@ class lazyancestors(object):
if inclusive:
self._containsseen = set(revs)
else:
self._containsseen = set()
+ def __nonzero__(self):
+ """False if the set is empty, True otherwise."""
+ try:
+ iter(self).next()
+ return True
+ except StopIteration:
+ return False
+
def __iter__(self):
"""Generate the ancestors of _initrevs in reverse topological order.
If inclusive is False, yield a sequence of revision numbers starting
with the parents of each revision in revs, i.e., each revision is *not*