changeset 22743:eccf9907b844

addset: add a __nonzero__ method This is required to be a full smartset (not sure what was happening before that...)
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 03 Oct 2014 00:12:22 -0500
parents 6bbc26adcc6a
children 3ed3ca4dfd31
files mercurial/revset.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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: