# HG changeset patch # User Pierre-Yves David # Date 1412193796 18000 # Node ID d8a08b68f754d8d93a01b0e671748134a58661de # Parent d7ab5684711f10e0dd20a833728d60f0868411bd revset: add a `__nonzero__` to baseset We are about to add a base class for `baseset` with an abstract `__nonzero__` method. So we need this method to be explicitly defined to avoid issues. The built-in list object apparently does not have a `__nonzero__` and relies on `__len__` for this purpose? diff -r d7ab5684711f -r d8a08b68f754 mercurial/revset.py --- a/mercurial/revset.py Wed Oct 01 15:50:54 2014 -0500 +++ b/mercurial/revset.py Wed Oct 01 15:03:16 2014 -0500 @@ -2238,6 +2238,9 @@ def __contains__(self): return self.set().__contains__ + def __nonzero__(self): + return bool(len(self)) + def __sub__(self, other): """Returns a new object with the substraction of the two collections.