dirstatemap: remove `_insert_entry`
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 23 Mar 2022 17:13:18 +0100
changeset 49103 77dfde417e5e
parent 49102 358b1a1e3678
child 49104 b5c2aca84618
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
mercurial/dirstatemap.py
--- 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)