[PATCH 4 of 4] revset: added basic operators to orderedlazyset

Simon King simon at simonking.org.uk
Fri Feb 28 03:44:38 CST 2014


On Thu, Feb 27, 2014 at 11:54 PM, Lucas Moscovicz <lmoscovicz at fb.com> wrote:
> # HG changeset patch
> # User Lucas Moscovicz <lmoscovicz at fb.com>
> # Date 1391737328 28800
> #      Thu Feb 06 17:42:08 2014 -0800
> # Node ID d9c1f97dac5f752a9def8f03bcb6604b8ee05c39
> # Parent  7a2d42d243dcc61aad03d90ee83e0878fef7cd12
> revset: added basic operators to orderedlazyset
>
> Now __add__ and __sub__ return orderedlazyset.
>
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -2221,6 +2221,14 @@
>      def filter(self, l):
>          return orderedlazyset(self, l, ascending=self._ascending)
>
> +    def __and__(self, x):
> +        return orderedlazyset(self, lambda r: r in x,
> +                ascending=self._ascending)

Is this a typo? The patch description says __add__, but the method
you've added is __and__.

Simon


More information about the Mercurial-devel mailing list