Patchwork D12455: dirstatemap: remove `_insert_entry`

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

Comments

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

REVISION SUMMARY
  This was needed as a compatibility layer for the Python and Rust
  implementations, but it is not called from anywhere in Rust anymore.
  
  The two remaining calls have been inlined.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -101,12 +101,6 @@ 
     def _refresh_entry(self, f, entry):
         """record updated state of an entry"""
 
-    def _insert_entry(self, f, entry):
-        """add a new dirstate entry (or replace an unrelated one)
-
-        The fact it is actually new is the responsability of the caller
-        """
-
     def _drop_entry(self, f):
         """remove any entry for file f
 
@@ -511,7 +505,7 @@ 
             has_meaningful_mtime=has_meaningful_mtime,
             parentfiledata=parentfiledata,
         )
-        self._insert_entry(filename, entry)
+        self._map[filename] = entry
 
     def set_tracked(self, filename):
         new = False
@@ -522,7 +516,7 @@ 
                 wc_tracked=True,
             )
 
-            self._insert_entry(filename, entry)
+            self._map[filename] = entry
             new = True
         elif not entry.tracked:
             self._dirs_incr(filename, entry)
@@ -541,9 +535,6 @@ 
         if not entry.any_tracked:
             self._map.pop(f, None)
 
-    def _insert_entry(self, f, entry):
-        self._map[f] = entry
-
     def _drop_entry(self, f):
         self._map.pop(f, None)
         self.copymap.pop(f, None)
@@ -718,9 +709,6 @@ 
             else:
                 self._map.addfile(f, entry)
 
-        def _insert_entry(self, f, entry):
-            self._map.addfile(f, entry)
-
         def set_tracked(self, f):
             return self._map.set_tracked(f)