author | Georges Racinet <georges.racinet@octobus.net> |
Wed, 25 Dec 2019 15:17:55 +0100 | |
changeset 44005 | 6b332c1fc7fe |
parent 43579 | 9e1932eb41f9 |
child 44034 | ab595920de0e |
permissions | -rw-r--r-- |
43524
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
1 |
# mercurial.revlogutils -- basic utilities for revlog |
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
2 |
# |
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
3 |
# Copyright 2019 Pierre-Yves David <pierre-yves.david@octobus.net> |
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
4 |
# |
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
5 |
# This software may be used and distributed according to the terms of the |
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
6 |
# GNU General Public License version 2 or any later version. |
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
7 |
|
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
8 |
from __future__ import absolute_import |
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
9 |
from .. import error |
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
10 |
|
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
11 |
|
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
12 |
class NodeMap(dict): |
a7c0c5b5a50f
revlog: introduce an explicit NodeMap class for pure code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
39329
diff
changeset
|
13 |
def __missing__(self, x): |
43579
9e1932eb41f9
nodemap: use bytes for the error message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
43524
diff
changeset
|
14 |
raise error.RevlogError(b'unknown node: %s' % x) |