# HG changeset patch # User Lucas Moscovicz # Date 1394817749 25200 # Node ID 180d47e1fb68138adac2e6b523897da25bdc2af7 # Parent caa69cb223b09960a777490fd7f1e2d296375a17 revset: added __and__ method to _addset This method is intended to duck-type baseset, so we will still have _addset as a private class but we will be able to return it without wrapping it into an orderedlazyset or a lazyset. diff -r caa69cb223b0 -r 180d47e1fb68 mercurial/revset.py --- a/mercurial/revset.py Fri Mar 14 10:21:56 2014 -0700 +++ b/mercurial/revset.py Fri Mar 14 10:22:29 2014 -0700 @@ -2413,6 +2413,12 @@ if self._ascending: self.reverse() + def __and__(self, other): + filterfunc = other.__contains__ + if self._ascending is not None: + return orderedlazyset(self, filterfunc, ascending=self._ascending) + return lazyset(self, filterfunc) + def _iterator(self): """Iterate over both collections without repeating elements