Mercurial > hg
comparison mercurial/revlogutils/__init__.py @ 43524:a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
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.
Differential Revision: https://phab.mercurial-scm.org/D7312
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 06 Nov 2019 14:13:19 +0100 |
parents | 729082bb9938 |
children | 9e1932eb41f9 |
comparison
equal
deleted
inserted
replaced
43523:c21aca51b392 | 43524:a7c0c5b5a50f |
---|---|
1 # mercurial.revlogutils -- basic utilities for revlog | |
2 # | |
3 # Copyright 2019 Pierre-Yves David <pierre-yves.david@octobus.net> | |
4 # | |
5 # This software may be used and distributed according to the terms of the | |
6 # GNU General Public License version 2 or any later version. | |
7 | |
8 from __future__ import absolute_import | |
9 from .. import error | |
10 | |
11 | |
12 class NodeMap(dict): | |
13 def __missing__(self, x): | |
14 raise error.RevlogError('unknown node: %s' % x) |