From patchwork Sat Oct 2 15:05:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11575: dirstatemap: use common code for set_possibly_dirty From: phabricator X-Patchwork-Id: 49899 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 2 Oct 2021 15:05:38 +0000 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 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]