changeset 47704:8a50fb0784a9

dirstate: introduce a `set_clean` method This will provide a good alternative to `normal` call with a narrower semantic. Differential Revision: https://phab.mercurial-scm.org/D11146
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 19 Jul 2021 00:47:59 +0200
parents 7d2f0e14da4c
children 6975cef3add1
files mercurial/dirstate.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Mon Jul 19 00:04:24 2021 +0200
+++ b/mercurial/dirstate.py	Mon Jul 19 00:47:59 2021 +0200
@@ -499,6 +499,13 @@
             self._remove(filename)
             return True
 
+    @requires_no_parents_change
+    def set_clean(self, filename, parentfiledata=None):
+        """record that the current state of the file on disk is known to be clean"""
+        self._dirty = True
+        self._updatedfiles.add(filename)
+        self.normal(filename, parentfiledata=parentfiledata)
+
     @requires_parents_change
     def update_file_p1(
         self,