Mercurial > hg
diff mercurial/dirstate.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 | 2e0ff3947b05 |
children | 36c0d738c330 |
line wrap: on
line diff
--- a/mercurial/dirstate.py Thu Sep 02 04:03:20 2021 +0200 +++ b/mercurial/dirstate.py Thu Sep 02 03:59:35 2021 +0200 @@ -508,10 +508,9 @@ (mode, size, mtime) = parentfiledata else: (mode, size, mtime) = self._get_filedata(filename) - self._addpath(filename, mode=mode, size=size, mtime=mtime) - self._map.copymap.pop(filename, None) - if filename in self._map.nonnormalset: - self._map.nonnormalset.remove(filename) + if not self._map[filename].tracked: + self._check_new_tracked_filename(filename) + self._map.set_clean(filename, mode, size, mtime) if mtime > self._lastnormaltime: # Remember the most recent modification timeslot for status(), # to make sure we won't miss future size-preserving file content