[patch 3/7] Add revlog.strip to truncate away revisions.

Chris Mason mason at suse.com
Mon Aug 22 15:47:22 CDT 2005


On Mon, 22 Aug 2005 13:09:33 -0700
Matt Mackall <mpm at selenic.com> wrote:

> On Mon, Aug 22, 2005 at 01:44:37PM -0400, Chris Mason wrote:
> >  
> >          if len(i) > 10000:
> >              # big index, let's parse it on demand
> > -            parser = lazyparser(i, self)
> > -            self.index = lazyindex(parser)
> > -            self.nodemap = lazymap(parser)
> > +            self.parser = lazyparser(i, self)
> > +            self.index = lazyindex(self.parser)
> > +            self.nodemap = lazymap(self.parser)
> 
> Something odd's going on here. Formerly, we had an optimization where
> once we'd read in the entire index, we could replace the lazy elements
> in revlog with the full elements.
> 

self.parser comes from the need for the strip code to find the lazy
parser and truncate it to the new size. When the lazy parser does
self.all = 1, the lazy elements are still replaced.

I'll change the patch to do a self.revlog.parser = None when self.all
is set to 1.  The current code will still work without that change, but
it's more correct to reset things.

More importantly, I missed the circular reference between the parser
and lazymap.  I'll toss in a weakref to fix that.

-chris


-chris


More information about the Mercurial mailing list