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.
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 :)