revset: prevent infinite recursion on pypy
as explained in the commit, __len__ cannot do [x for x in self] because
that can potentially call __len__ again, causing infinite recursion
--- a/mercurial/revset.py Thu Mar 31 18:38:08 2016 +0200
+++ b/mercurial/revset.py Fri Apr 01 10:09:34 2016 +0200
@@ -2956,7 +2956,10 @@
def __len__(self):
# Basic implementation to be changed in future patches.
- l = baseset([r for r in self])
+ # until this gets improved, we use generator expression
+ # here, since list compr is free to call __len__ again
+ # causing infinite recursion
+ l = baseset(r for r in self)
return len(l)
def sort(self, reverse=False):