This is an archive of the discontinued Mercurial Phabricator instance.

revlog: introduce an explicit NodeMap class for pure code
ClosedPublic

Authored by marmoute on Nov 8 2019, 4:28 AM.

Details

Summary

This class make the "pure" nodemap raise the same exception than the C-extension
one.

This is a step toward unifying nodemap and index, the class is not meant to
survive on the long run.

This work is part of a refactoring to unify the revlog index and the nodemap.
This unification prepare the use of a persistent nodemap.

There is a new isinstance call, it will be cleaned up in coming changesets.

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

marmoute created this revision.Nov 8 2019, 4:28 AM
indygreg accepted this revision.Nov 8 2019, 2:27 PM

I hope the end state of this series establishes a formal interface for the index API. There is so much low-hanging fruit to be realized there. And we desperately need a format interface to abstract changelog storage.

This revision is now accepted and ready to land.Nov 8 2019, 2:27 PM
yuja added a subscriber: yuja.Nov 10 2019, 4:45 AM

+class NodeMap(dict):
+ def missing(self, x):
+ raise error.RevlogError('unknown node: %s' % x)

Missed b'' and node.hex|short()?