[PATCH] mq: use util.propertycache, introduce method invalidate for mq and repo

Matt Mackall mpm at selenic.com
Tue May 5 09:05:03 CDT 2009


On Tue, May 05, 2009 at 01:23:06PM +0200, Simon Heimberg wrote:
> > > +    @util.propertycache
> > > +    def series(self):
> > > +        self.parse_series()
> > > +        return self.series
> > 
> > IMHO, having a method return "itself" looks strange :-) What really
> > happens is that the call to parse_series changes self.series (and
> > self.series_guards) from a method to a list(!), which you return. The
> > util.propertycache decorator then takes the returned list and assigns it
> > to self.series (again).
> This is how it is done in dirstate for _map and _copymap. I do not know
> how to do it different.

If we cared, you could make parse_series return the series. But it
doesn't always make sense to work around such things.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list