This is an archive of the discontinued Mercurial Phabricator instance.

manifest: set appropriate cache entry when clearing _dirlogcache()
ClosedPublic

Authored by indygreg on Aug 13 2018, 12:55 PM.

Details

Summary

manifestrevlog applies to any manifest, not just the root manifest.
Resetting the cache and populating its root entry with self is not
correct when the instance does not refer to the root manifest.

This has no test fallout. So I'm guessing we only ever call
clearcaches() on the root manifest. Or we have no test coverage that
are impacted by a bad cache on a non-root manifestrevlog.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Aug 13 2018, 12:55 PM
This revision was automatically updated to reflect the committed changes.
martinvonz added inline comments.
mercurial/manifest.py
1328

All the manifestrevlogs share a single cache that is stored on the root manifest (see comment and code around line 1288), so this change should have no effect. And yes, clearcaches() will only be called on the root manifest.

The code here was more consistent (with line 1292) before this patch, but it doesn't bother me enough that I'll send a backout patch :)