--- a/mercurial/pure/parsers.py Wed Jan 15 15:47:59 2020 +0100
+++ b/mercurial/pure/parsers.py Wed Jan 15 15:48:09 2020 +0100
@@ -141,6 +141,15 @@
self._extra = self._extra[: i - self._lgt]
+class PersistentNodeMapIndexObject(IndexObject):
+ """a Debug oriented class to test persistent nodemap
+
+ We need a simple python object to test API and higher level behavior. See
+ the Rust implementation for more serious usage. This should be used only
+ through the dedicated `devel.persistent-nodemap` config.
+ """
+
+
class InlinedIndexObject(BaseIndexObject):
def __init__(self, data, inline=0):
self._data = data
@@ -188,6 +197,12 @@
return InlinedIndexObject(data, inline), (0, data)
+def parse_index_devel_nodemap(data, inline):
+ """like parse_index2, but alway return a PersistentNodeMapIndexObject
+ """
+ return PersistentNodeMapIndexObject(data), None
+
+
def parse_dirstate(dmap, copymap, st):
parents = [st[:20], st[20:40]]
# dereference fields so they will be local in loop