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

Simon Heimberg simohe at besonet.ch
Tue May 5 09:15:29 CDT 2009


Am Dienstag, den 05.05.2009, 09:05 -0500 schrieb Matt Mackall:
> 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.
> 
But parse_series sets series and series_guards. Should I return bought
and set the one which is not returned? Would this look nicer?


More information about the Mercurial-devel mailing list