Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

Commit 6e310154 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

dirstate-item: make sure we set the mtime-second-ambiguous on v2 write

We want to preserve the second-ambiguity alongside the ambiguous mtime. So we
use the decimated flag for that.

note: the C code was already doing so. No change was needed to it.

Differential Revision: https://phab.mercurial-scm.org/D11845
parent 0b3f3a3ca50a
......@@ -483,6 +483,8 @@ class DirstateItem(object):
flags |= DIRSTATE_V2_MODE_IS_SYMLINK
if self._mtime_s is not None:
flags |= DIRSTATE_V2_HAS_MTIME
if self._mtime_second_ambiguous:
flags |= DIRSTATE_V2_MTIME_SECOND_AMBIGUOUS
if self._fallback_exec is not None:
flags |= DIRSTATE_V2_HAS_FALLBACK_EXEC
......
......@@ -43,7 +43,10 @@ pub struct TruncatedTimestamp {
truncated_seconds: u32,
/// Always in the `0 .. 1_000_000_000` range.
nanoseconds: u32,
second_ambiguous: bool,
/// TODO this should be in DirstateEntry, but the current code needs
/// refactoring to use DirstateEntry instead of TruncatedTimestamp for
/// comparison.
pub second_ambiguous: bool,
}
impl TruncatedTimestamp {
......
......@@ -465,6 +465,9 @@ impl Node {
};
let mtime = if let Some(m) = mtime_opt {
flags.insert(Flags::HAS_MTIME);
if m.second_ambiguous {
flags.insert(Flags::MTIME_SECOND_AMBIGUOUS);
};
m.into()
} else {
PackedTruncatedTimestamp::null()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment