# HG changeset patch # User Pierre-Yves David # Date 2021-07-18 22:47:59 # Node ID 8a50fb0784a9d66723ec84e190d6a73abac68537 # Parent 7d2f0e14da4ccc794f7fa6fb37163e95c640a9e8 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 diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -499,6 +499,13 @@ class dirstate(object): 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,