comparison rust/hg-core/src/dirstate_tree/status.rs @ 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 b80e5e75d51e dcec16e799dd
comparison
equal deleted inserted replaced
48262:68bb472aee9c 48263:83d0bd45b662
529 .push(hg_path.detach_from_tree()) 529 .push(hg_path.detach_from_tree())
530 } else { 530 } else {
531 let mtime_looks_clean; 531 let mtime_looks_clean;
532 if let Some(dirstate_mtime) = entry.truncated_mtime() { 532 if let Some(dirstate_mtime) = entry.truncated_mtime() {
533 let fs_mtime = TruncatedTimestamp::for_mtime_of(fs_metadata) 533 let fs_mtime = TruncatedTimestamp::for_mtime_of(fs_metadata)
534 .expect("OS/libc does not support mtime?") 534 .expect("OS/libc does not support mtime?");
535 // For now don’t use sub-second precision for file mtimes
536 .to_integer_second();
537 mtime_looks_clean = fs_mtime.likely_equal(dirstate_mtime) 535 mtime_looks_clean = fs_mtime.likely_equal(dirstate_mtime)
538 && !fs_mtime.likely_equal(self.options.last_normal_time) 536 && !fs_mtime.likely_equal(self.options.last_normal_time)
539 } else { 537 } else {
540 // No mtime in the dirstate entry 538 // No mtime in the dirstate entry
541 mtime_looks_clean = false 539 mtime_looks_clean = false