lazyset: inherit the fastasc and fastdesc method from subset
When the filtered subset has such methods, we can use them. It is implemented
as properties to be able to quickly return None if no corresponding fastasc exists
on the subset.
--- a/mercurial/revset.py Thu Oct 02 18:25:37 2014 -0500
+++ b/mercurial/revset.py Tue Sep 30 23:36:57 2014 -0500
@@ -2444,6 +2444,20 @@
if cond(x):
yield x
+ @property
+ def fastasc(self):
+ it = self._subset.fastasc
+ if it is None:
+ return None
+ return lambda: self._iterfilter(it())
+
+ @property
+ def fastdesc(self):
+ it = self._subset.fastdesc
+ if it is None:
+ return None
+ return lambda: self._iterfilter(it())
+
def __and__(self, x):
return lazyset(self, x.__contains__)