Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 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 |
comparison
equal
deleted
inserted
replaced
22742:6bbc26adcc6a | 22743:eccf9907b844 |
---|---|
2575 self._genlist = None | 2575 self._genlist = None |
2576 | 2576 |
2577 def __len__(self): | 2577 def __len__(self): |
2578 return len(self._list) | 2578 return len(self._list) |
2579 | 2579 |
2580 def __nonzero__(self): | |
2581 return bool(self._r1 or self._r2) | |
2582 | |
2580 @util.propertycache | 2583 @util.propertycache |
2581 def _list(self): | 2584 def _list(self): |
2582 if not self._genlist: | 2585 if not self._genlist: |
2583 self._genlist = baseset(self._iterator()) | 2586 self._genlist = baseset(self._iterator()) |
2584 return self._genlist | 2587 return self._genlist |