[BUG] stat cache doesn't handle old pathnames with new ids properly

Martin Pool mbp at sourcefrog.net
Fri Jul 8 08:02:09 BST 2005


On  4 Jul 2005, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> Martin Pool wrote:
> > On  3 Jul 2005, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> 
> >>Is there any particular reason why the statcache is indexed by id,
> >>rather than pathname?
> 
> > I don't think there's any good reason.

OK, this is now changed; the next time you access a tree it should
automatically upgrade to a new format for the cache.  This also uses the
idea of terminating the name with // rather than nul separators.

I also renamed the module to hashcache because as John(?) pointed out
it's completely different to the standard module called statcache.

> Oh, and a more wacky approach would be to index by stat data, instead of
> id or pathname.  That would mean you could rename or move the file
> without having to SHA-1 it again.  Probably not worth the loss of
> clarity over indexing by pathname, but a fun idea.

It requires similar data but I'm not sure if it's really a good idea to
couple them together.  The statcache gets updated every time the files 
are re-read and their SHA is written out, and so can happen on almost
every operation that affects the tree, including read-only operations.
But I'm not sure if detection of renames should really happen without
user intervention.

-- 
Martin




More information about the bazaar mailing list