mercurial/ancestor.py
changeset 22225 baecf4e1b7d0
parent 21101 64911a12dc28
child 23328 3a7d9c0c57a5
--- a/mercurial/ancestor.py	Fri Aug 15 15:25:12 2014 -0700
+++ b/mercurial/ancestor.py	Fri Aug 15 15:57:50 2014 -0700
@@ -246,6 +246,14 @@
         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.