diff mercurial/pure/parsers.py @ 47974:4e6f27230aee

dirstate: introduce a `set_clean` method on dirstate's map and items This method is the "reverse" of "set possibly dirty", and can be used to more accurately other call that the dirstate was making. It is currently heavily influenced by its origin. Differential Revision: https://phab.mercurial-scm.org/D11421
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 02 Sep 2021 03:59:35 +0200
parents 508394e38580
children 0d2a404f1932
line wrap: on
line diff
--- a/mercurial/pure/parsers.py	Thu Sep 02 04:03:20 2021 +0200
+++ b/mercurial/pure/parsers.py	Thu Sep 02 03:59:35 2021 +0200
@@ -222,6 +222,24 @@
         """
         self._possibly_dirty = True
 
+    def set_clean(self, mode, size, mtime):
+        """mark a file as "clean" cancelling potential "possibly dirty call"
+
+        Note: this function is a descendant of `dirstate.normal` and is
+        currently expected to be call on "normal" entry only. There are not
+        reason for this to not change in the future as long as the ccode is
+        updated to preserve the proper state of the non-normal files.
+        """
+        self._wc_tracked = True
+        self._p1_tracked = True
+        self._p2_tracked = False  # this might be wrong
+        self._merged = False
+        self._clean_p2 = False
+        self._possibly_dirty = False
+        self._mode = mode
+        self._size = size
+        self._mtime = mtime
+
     def set_untracked(self):
         """mark a file as untracked in the working copy