addset: add a __nonzero__ method
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 03 Oct 2014 00:12:22 -0500
changeset 22743 eccf9907b844
parent 22742 6bbc26adcc6a
child 22744 3ed3ca4dfd31
addset: add a __nonzero__ method This is required to be a full smartset (not sure what was happening before that...)
mercurial/revset.py
--- a/mercurial/revset.py	Thu Oct 02 23:38:30 2014 -0500
+++ b/mercurial/revset.py	Fri Oct 03 00:12:22 2014 -0500
@@ -2577,6 +2577,9 @@
     def __len__(self):
         return len(self._list)
 
+    def __nonzero__(self):
+        return bool(self._r1 or self._r2)
+
     @util.propertycache
     def _list(self):
         if not self._genlist: