This is an archive of the discontinued Mercurial Phabricator instance.

revlog: store flag processors per revlog
ClosedPublic

Authored by indygreg on Sep 18 2018, 6:40 PM.

Details

Summary

Previously, revlog flag processing would consult a global dict
when processing flags. This was simple. But it had the undesired
side-effect that any extension could load flag processors once
and those flag processors would be available to any revlog that was
subsequent loaded in the process. e.g. in hgweb, if the narrow
extension were loaded for repo A but not repo B, repo B would be
able to decode ellipsis flags even though it shouldn't be able to.

Making the flag processors dict per-revlog allows us to have per-revlog
controls over what flag processors are available, thus preserving
desired granular access to flag processors depending on the revlog's
needs.

If a flag processor is globally registered, it is still globally
available. So this commit should not meaningfully change behavior.

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.Sep 18 2018, 6:40 PM
This revision was automatically updated to reflect the committed changes.