[PATCH 1 of 2 RFC] revset: added generatorset class with cached __contains__ method

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Feb 13 22:58:32 UTC 2014



On 02/13/2014 02:56 PM, Lucas Moscovicz wrote:
> # HG changeset patch
> # User Lucas Moscovicz <lmoscovicz at fb.com>
> # Date 1391642591 28800
> #      Wed Feb 05 15:23:11 2014 -0800
> # Node ID f4d973e19d267efa440d992583a860fc2f8eed98
> # Parent  365b233e02ebf05d1b91e48d12f28f0c5ddd990c
> revset: added generatorset class with cached __contains__ method
>
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -2145,6 +2145,36 @@
>       def set(self):
>           return set([r for r in self])
>
> +class generatorset(object):
> +    def __init__(self, gen):

Now that the big picture is emerging, I believe you should start adding 
docstring to you code. Otherwise we'll end up with a very cool pile of 
code that nobody can read without burning its brain for a day (MQ And 
hgweb, I'm looking at you)



More information about the Mercurial-devel mailing list