abstractsmartset: add default implementation for __and__
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 02 Oct 2014 19:21:40 -0500
changeset 22728 bf5ff3686100
parent 22727 0f3e240a1c35
child 22729 f7b0ebe6ad42
abstractsmartset: add default implementation for __and__
mercurial/revset.py
--- a/mercurial/revset.py	Wed Oct 01 00:26:50 2014 -0500
+++ b/mercurial/revset.py	Thu Oct 02 19:21:40 2014 -0500
@@ -2274,7 +2274,7 @@
         """Returns a new object with the intersection of the two collections.
 
         This is part of the mandatory API for smartset."""
-        raise NotImplementedError()
+        return self.filter(other.__contains__)
 
     def __add__(self, other):
         """Returns a new object with the union of the two collections.