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

Matt Mackall mpm at selenic.com
Thu Feb 13 17:23:08 CST 2014


On Thu, 2014-02-13 at 14:58 -0800, Pierre-Yves David wrote:
> 
> 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)

Agreed, these look fine with a bit more docs/comments.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list