From patchwork Wed Nov 8 17:31:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1347: dirstate: make map implementation overridable From: phabricator X-Patchwork-Id: 25431 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Wed, 8 Nov 2017 17:31:36 +0000 mbthomas created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 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. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1347 AFFECTED FILES mercurial/dirstate.py CHANGE DETAILS To: mbthomas, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -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): '''Returns the dirstate map.''' - self._map = dirstatemap(self._ui, self._opener, self._root) + self._map = self._mapcls(self._ui, self._opener, self._root) return self._map @property