dirstate: make map implementation overridable
authorMark Thomas <mbthomas@fb.com>
Wed, 15 Nov 2017 01:07:42 -0800
changeset 35086 8db4ca768416
parent 35085 ae7ad53d3c8d
child 35087 dd000a958364
dirstate: make map implementation overridable Other implementations of dirstate will want to replace the class used for the dirstate map. Allow this to happen by making the class an attribute of the dirstate. Differential Revision: https://phab.mercurial-scm.org/D1347
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Nov 15 01:07:42 2017 -0800
+++ b/mercurial/dirstate.py	Wed Nov 15 01:07:42 2017 -0800
@@ -80,6 +80,7 @@
         self._plchangecallbacks = {}
         self._origpl = None
         self._updatedfiles = set()
+        self._mapcls = dirstatemap
 
     @contextlib.contextmanager
     def parentchange(self):
@@ -128,7 +129,7 @@
     @propertycache
     def _map(self):
         """Return the dirstate contents (see documentation for dirstatemap)."""
-        self._map = dirstatemap(self._ui, self._opener, self._root)
+        self._map = self._mapcls(self._ui, self._opener, self._root)
         return self._map
 
     @property