mercurial/dirstatemap.py
changeset 48126 a1a6569b9283
parent 48125 de793f249852
child 48127 ced8cf9c4905
--- a/mercurial/dirstatemap.py	Fri Oct 01 18:52:26 2021 +0200
+++ b/mercurial/dirstatemap.py	Fri Oct 01 18:54:40 2021 +0200
@@ -98,6 +98,9 @@
         tracking in a different way.
         """
 
+    def _refresh_entry(self, f, entry):
+        """record updated state of an entry"""
+
 
 class dirstatemap(_dirstatemapcommon):
     """Map encapsulating the dirstate's contents.
@@ -381,6 +384,10 @@
 
     ### code related to manipulation of entries and copy-sources
 
+    def _refresh_entry(self, f, entry):
+        if not entry.any_tracked:
+            self._map.pop(f, None)
+
     def set_possibly_dirty(self, filename):
         """record that the current state of the file on disk is unknown"""
         self[filename].set_possibly_dirty()
@@ -770,6 +777,12 @@
 
         ### code related to manipulation of entries and copy-sources
 
+        def _refresh_entry(self, f, entry):
+            if not entry.any_tracked:
+                self._map.drop_item_and_copy_source(f)
+            else:
+                self._map.addfile(f, entry)
+
         def set_possibly_dirty(self, filename):
             """record that the current state of the file on disk is unknown"""
             entry = self[filename]