diff mercurial/dirstateutils/v2.py @ 48263:83d0bd45b662

dirstate-v2: actually use sub-second mtime precision Instead of zero, set the nanoseconds field to its correct value whenever possible and preserve it across serialization+parsing. Differential Revision: https://phab.mercurial-scm.org/D11702
author Simon Sapin <simon.sapin@octobus.net>
date Wed, 13 Oct 2021 15:58:14 +0200
parents 269ff8978086
children bb240915f69f
line wrap: on
line diff
--- a/mercurial/dirstateutils/v2.py	Thu Oct 14 13:54:39 2021 +0200
+++ b/mercurial/dirstateutils/v2.py	Wed Oct 13 15:58:14 2021 +0200
@@ -101,15 +101,12 @@
             flags,
             size,
             mtime_s,
-            _mtime_ns,
+            mtime_ns,
         ) = NODE.unpack(node_bytes)
 
         # Parse child nodes of this node recursively
         parse_nodes(map, copy_map, data, children_start, children_count)
 
-        # Don’t yet use sub-second precision if it exists in the file,
-        # since other parts of the code still set it to zero.
-        mtime_ns = 0
         item = parsers.DirstateItem.from_v2_data(flags, size, mtime_s, mtime_ns)
         if not item.any_tracked:
             continue