changeset 22727:0f3e240a1c35

abstractsmartset: add default implementation for filter
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 01 Oct 2014 00:26:50 -0500
parents 169aa5e74b52
children bf5ff3686100
files mercurial/revset.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Fri Oct 03 01:16:23 2014 -0500
+++ b/mercurial/revset.py	Wed Oct 01 00:26:50 2014 -0500
@@ -2295,7 +2295,12 @@
         boolean.
 
         This is part of the mandatory API for smartset."""
-        raise NotImplementedError()
+        kwargs = {}
+        if self.isascending():
+            kwargs['ascending'] = True
+        elif self.isdescending():
+            kwargs['ascending'] = False
+        return filteredset(self, condition, **kwargs)
 
 class baseset(list, abstractsmartset):
     """Basic data structure that represents a revset and contains the basic