The _branchcache global gives us a reference for super() to use even if an
extension subclasses branchmap.branchcache then replaces the class in the
module.
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Comment Actions
The _branchcache global gives us a reference for super() to use even if an extension subclasses branchmap.branchcache then replaces the class in the module.
Can't we instead add a factory function which can be easily hooked by
extensions?
It should be discouraged to replace a class globally.
Comment Actions
This would need more thought then; the evolve/topic/topicmap codebase wraps the whole branchmap.branchcache class and mucks about with a context manager to re-instate the right name in the branchmap globals so super() doesn't break, which is what led to this patch.