changeset 49103:77dfde417e5e

dirstatemap: remove `_insert_entry` 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. Differential Revision: https://phab.mercurial-scm.org/D12501
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 23 Mar 2022 17:13:18 +0100
parents 358b1a1e3678
children b5c2aca84618
files mercurial/dirstatemap.py
diffstat 1 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Wed Mar 23 17:25:42 2022 +0100
+++ b/mercurial/dirstatemap.py	Wed Mar 23 17:13:18 2022 +0100
@@ -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)