changeset 48137:de793f249852

dirstatemap: create `_dirs_incr/_dirs_decr` methods on the common class The Rust wrapper does not need them. However having a default, no-op, implementation will help use to write code used by both implementation. Differential Revision: https://phab.mercurial-scm.org/D11570
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Oct 2021 18:52:26 +0200
parents 08e04bb0bff3
children a1a6569b9283
files mercurial/dirstatemap.py
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Fri Oct 01 18:49:21 2021 +0200
+++ b/mercurial/dirstatemap.py	Fri Oct 01 18:52:26 2021 +0200
@@ -79,6 +79,25 @@
     def __getitem__(self, item):
         return self._map[item]
 
+    ### sub-class utility method
+    #
+    # Use to allow for generic implementation of some method while still coping
+    # with minor difference between implementation.
+
+    def _dirs_incr(self, filename, old_entry=None):
+        """incremente the dirstate counter if applicable
+
+        This might be a no-op for some subclass who deal with directory
+        tracking in a different way.
+        """
+
+    def _dirs_decr(self, filename, old_entry=None, remove_variant=False):
+        """decremente the dirstate counter if applicable
+
+        This might be a no-op for some subclass who deal with directory
+        tracking in a different way.
+        """
+
 
 class dirstatemap(_dirstatemapcommon):
     """Map encapsulating the dirstate's contents.