Patchwork D12470: dirstatemap: move `_dirs_incr` and `_dirs_decr` methods out of the common

login
register
mail settings
Submitter phabricator
Date April 6, 2022, 2:12 p.m.
Message ID <differential-rev-PHID-DREV-ortpeutngthzd6noilgv-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50816/
State New
Headers show

Comments

phabricator - April 6, 2022, 2:12 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  They are only used by the Python implementation now

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12470

AFFECTED FILES
  mercurial/dirstatemap.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -79,25 +79,6 @@ 
     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):
-        """increment the dirstate counter if applicable
-
-        This might be a no-op for some subclasses who deal with directory
-        tracking in a different way.
-        """
-
-    def _dirs_decr(self, filename, old_entry=None, remove_variant=False):
-        """decrement the dirstate counter if applicable
-
-        This might be a no-op for some subclasses who deal with directory
-        tracking in a different way.
-        """
-
     ### disk interaction
 
     def _opendirstatefile(self):
@@ -354,7 +335,7 @@ 
     # (e.g. "has_dir")
 
     def _dirs_incr(self, filename, old_entry=None):
-        """incremente the dirstate counter if applicable"""
+        """increment the dirstate counter if applicable"""
         if (
             old_entry is None or old_entry.removed
         ) and "_dirs" in self.__dict__:
@@ -363,7 +344,7 @@ 
             self._alldirs.addpath(filename)
 
     def _dirs_decr(self, filename, old_entry=None, remove_variant=False):
-        """decremente the dirstate counter if applicable"""
+        """decrement the dirstate counter if applicable"""
         if old_entry is not None:
             if "_dirs" in self.__dict__ and not old_entry.removed:
                 self._dirs.delpath(filename)