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
--- 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)