diff mercurial/revlogutils/nodemap.py @ 44035:ab595920de0e

revlogutils: move the NodeMap class in a dedicated nodemap module We will introduce more nodemap related code, so it make sense to move the existing code in that module first. Differential Revision: https://phab.mercurial-scm.org/D7809
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 07 Jan 2020 12:26:37 +0100
parents
children c577bb4a04d4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/revlogutils/nodemap.py	Tue Jan 07 12:26:37 2020 +0100
@@ -0,0 +1,15 @@
+# nodemap.py - nodemap related code and utilities
+#
+# Copyright 2019 Pierre-Yves David <pierre-yves.david@octobus.net>
+# Copyright 2019 George Racinet <georges.racinet@octobus.net>
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+from __future__ import absolute_import
+from .. import error
+
+
+class NodeMap(dict):
+    def __missing__(self, x):
+        raise error.RevlogError(b'unknown node: %s' % x)