Patchwork D11575: dirstatemap: use common code for set_possibly_dirty

login
register
mail settings
Submitter phabricator
Date Oct. 2, 2021, 3:05 p.m.
Message ID <differential-rev-PHID-DREV-wig42o3eqzd5a7ptvvho-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49899/
State Superseded
Headers show

Comments

phabricator - Oct. 2, 2021, 3:05 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Same logic before this make sure both implementation use the same logic for this.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11575

AFFECTED FILES
  mercurial/dirstatemap.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -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]