[Request] [+ ] D11564: dirstatemap: introduce a common base for the dirstatemap class
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Sat Oct 2 15:04:35 UTC 2021
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
We have two dirstatemaps class. One for the python version of the dirstate map
and one for the Rust version (that has a python wrapper to deal with some
aspect of it). We end up with duplicated code between them, so we introduce a
common base class to start migrating common code in them.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D11564
AFFECTED FILES
mercurial/dirstatemap.py
CHANGE DETAILS
diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -35,7 +35,14 @@
rangemask = 0x7FFFFFFF
-class dirstatemap(object):
+class _dirstatemapcommon(object):
+ """
+ Methods that are identical for both implementations of the dirstatemap
+ class, with and without Rust extensions enabled.
+ """
+
+
+class dirstatemap(_dirstatemapcommon):
"""Map encapsulating the dirstate's contents.
The dirstate contains the following state:
@@ -460,7 +467,7 @@
if rustmod is not None:
- class dirstatemap(object):
+ class dirstatemap(_dirstatemapcommon):
def __init__(self, ui, opener, root, nodeconstants, use_dirstate_v2):
self._use_dirstate_v2 = use_dirstate_v2
self._nodeconstants = nodeconstants
To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20211002/e828877d/attachment.html>
More information about the Mercurial-patches
mailing list