# HG changeset patch # User Pierre-Yves David # Date 1625185038 -7200 # Node ID 91520abe2b2c55eb7ac0f5ffd45c94d384eb1985 # Parent 1f571077222d5c75e957fe2b105fbb5369277b4e dirstate: add an explicit `possibly_dirty` parameter to `_addpath` This lets says what we mean instead of using magic value. The lower level can then decide how to express that. Differential Revision: https://phab.mercurial-scm.org/D10932 diff -r 1f571077222d -r 91520abe2b2c mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Jul 02 02:01:10 2021 +0200 +++ b/mercurial/dirstate.py Fri Jul 02 02:17:18 2021 +0200 @@ -446,6 +446,7 @@ size=NONNORMAL, mtime=AMBIGUOUS_TIME, from_p2=False, + possibly_dirty=False, ): oldstate = self[f] if state == b'a' or oldstate == b'r': @@ -466,6 +467,8 @@ if from_p2: size = FROM_P2 mtime = AMBIGUOUS_TIME + elif possibly_dirty: + mtime = AMBIGUOUS_TIME else: assert size != FROM_P2 if size != NONNORMAL: @@ -522,7 +525,7 @@ return if entry[0] == b'm' or entry[0] == b'n' and entry[2] == FROM_P2: return - self._addpath(f, b'n', 0) + self._addpath(f, b'n', 0, possibly_dirty=True) self._map.copymap.pop(f, None) def otherparent(self, f):