revset: make __len__ part of the offical API
It is common for code to ask for the length of a revset. In fact, all but
generatorset already implement it.
--- a/mercurial/revset.py Sat Oct 04 16:46:50 2014 +0900
+++ b/mercurial/revset.py Wed Oct 15 04:26:23 2014 -0700
@@ -2255,6 +2255,12 @@
Return None if the set is empty"""
raise NotImplementedError()
+ def __len__(self):
+ """return the length of the smartsets
+
+ This can be expensive on smartset that could be lazy otherwise."""
+ raise NotImplementedError()
+
def reverse(self):
"""reverse the expected iteration order"""
raise NotImplementedError()