Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
48262:68bb472aee9c | 48263:83d0bd45b662 |
---|---|
99 _descendants_with_entry_count, | 99 _descendants_with_entry_count, |
100 _tracked_descendants_count, | 100 _tracked_descendants_count, |
101 flags, | 101 flags, |
102 size, | 102 size, |
103 mtime_s, | 103 mtime_s, |
104 _mtime_ns, | 104 mtime_ns, |
105 ) = NODE.unpack(node_bytes) | 105 ) = NODE.unpack(node_bytes) |
106 | 106 |
107 # Parse child nodes of this node recursively | 107 # Parse child nodes of this node recursively |
108 parse_nodes(map, copy_map, data, children_start, children_count) | 108 parse_nodes(map, copy_map, data, children_start, children_count) |
109 | 109 |
110 # Don’t yet use sub-second precision if it exists in the file, | |
111 # since other parts of the code still set it to zero. | |
112 mtime_ns = 0 | |
113 item = parsers.DirstateItem.from_v2_data(flags, size, mtime_s, mtime_ns) | 110 item = parsers.DirstateItem.from_v2_data(flags, size, mtime_s, mtime_ns) |
114 if not item.any_tracked: | 111 if not item.any_tracked: |
115 continue | 112 continue |
116 path = slice_with_len(data, path_start, path_len) | 113 path = slice_with_len(data, path_start, path_len) |
117 map[path] = item | 114 map[path] = item |