Page MenuHomePhabricator

revlog: introduce an explicit NodeMap class for pure code
ClosedPublic

Authored by marmoute on Fri, Nov 8, 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.Fri, Nov 8, 4:28 AM
indygreg accepted this revision.Fri, Nov 8, 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.Fri, Nov 8, 2:27 PM
yuja added a subscriber: yuja.Sun, Nov 10, 4:45 AM

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

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