# HG changeset patch # User Pierre-Yves David # Date 1625450231 -7200 # Node ID 1a6302427eb94d49b646462b4ce19d7ac4589313 # Parent 84391ddf4c7845e42a6d7640b66eae5f7c390d3c dirstate-item: use need_delay when packing dirstate Differential Revision: https://phab.mercurial-scm.org/D10984 diff -r 84391ddf4c78 -r 1a6302427eb9 mercurial/pure/parsers.py --- a/mercurial/pure/parsers.py Sun Jul 04 22:27:29 2021 +0200 +++ b/mercurial/pure/parsers.py Mon Jul 05 03:57:11 2021 +0200 @@ -39,6 +39,9 @@ # a special value used internally for `size` if the file is modified/merged/added NONNORMAL = -1 +# a special value used internally for `time` if the time is ambigeous +AMBIGUOUS_TIME = -1 + class DirstateItem(object): """represent a dirstate entry @@ -540,7 +543,7 @@ write = cs.write write(b"".join(pl)) for f, e in pycompat.iteritems(dmap): - if e[0] == b'n' and e[3] == now: + if e.need_delay(now): # The file was last modified "simultaneously" with the current # write to dirstate (i.e. within the same second for file- # systems with a granularity of 1 sec). This commonly happens @@ -550,7 +553,7 @@ # dirstate, forcing future 'status' calls to compare the # contents of the file if the size is the same. This prevents # mistakenly treating such files as clean. - e = DirstateItem(e[0], e[1], e[2], -1) + e = DirstateItem(e.state, e.mode, e.size, AMBIGUOUS_TIME) dmap[f] = e if f in copymap: