changeset 48130:743808de0c03

dirstatemap: use common code for set_possibly_dirty Same logic before this make sure both implementation use the same logic for this. Differential Revision: https://phab.mercurial-scm.org/D11575
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Oct 2021 23:42:24 +0200
parents a39192fc7c56
children f903a357ba72
files mercurial/dirstatemap.py
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Fri Oct 01 23:24:01 2021 +0200
+++ b/mercurial/dirstatemap.py	Fri Oct 01 23:42:24 2021 +0200
@@ -109,6 +109,12 @@
 
     ### method to manipulate the entries
 
+    def set_possibly_dirty(self, filename):
+        """record that the current state of the file on disk is unknown"""
+        entry = self[filename]
+        entry.set_possibly_dirty()
+        self._refresh_entry(filename, entry)
+
     def set_tracked(self, filename):
         new = False
         entry = self.get(filename)
@@ -443,10 +449,6 @@
     def _insert_entry(self, f, entry):
         self._map[f] = entry
 
-    def set_possibly_dirty(self, filename):
-        """record that the current state of the file on disk is unknown"""
-        self[filename].set_possibly_dirty()
-
     def set_clean(self, filename, mode, size, mtime):
         """mark a file as back to a clean state"""
         entry = self[filename]
@@ -799,12 +801,6 @@
         def _insert_entry(self, f, entry):
             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]
-            entry.set_possibly_dirty()
-            self._map.set_dirstate_item(filename, entry)
-
         def set_clean(self, filename, mode, size, mtime):
             """mark a file as back to a clean state"""
             entry = self[filename]