comparison rust/hg-core/src/dirstate/entry.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 68bb472aee9c
children d5a91701f7dc
comparison
equal deleted inserted replaced
48262:68bb472aee9c 48263:83d0bd45b662
87 } 87 }
88 #[cfg(not(unix))] 88 #[cfg(not(unix))]
89 { 89 {
90 metadata.modified().map(Self::from) 90 metadata.modified().map(Self::from)
91 } 91 }
92 }
93
94 pub fn to_integer_second(mut self) -> Self {
95 self.nanoseconds = 0;
96 self
97 } 92 }
98 93
99 /// The lower 31 bits of the number of seconds since the epoch. 94 /// The lower 31 bits of the number of seconds since the epoch.
100 pub fn truncated_seconds(&self) -> u32 { 95 pub fn truncated_seconds(&self) -> u32 {
101 self.truncated_seconds 96 self.truncated_seconds