##// END OF EJS Templates
dirstate-item: make sure we load `mtime-second-ambiguous` from disk...
marmoute -
r49231:be231716 default
parent child Browse files
Show More
@@ -450,14 +450,6 b' static PyObject *dirstate_item_from_v2_m'
450 450 dirstate_flag_has_meaningful_data |
451 451 dirstate_flag_has_mtime);
452 452 }
453 if (t->flags & dirstate_flag_mtime_second_ambiguous) {
454 /* The current code is not able to do the more subtle comparison
455 * that the MTIME_SECOND_AMBIGUOUS requires. So we ignore the
456 * mtime */
457 t->flags &= ~(dirstate_flag_mtime_second_ambiguous |
458 dirstate_flag_has_meaningful_data |
459 dirstate_flag_has_mtime);
460 }
461 453 t->mode = 0;
462 454 if (t->flags & dirstate_flag_has_meaningful_data) {
463 455 if (t->flags & dirstate_flag_mode_exec_perm) {
@@ -149,10 +149,6 b' class DirstateItem(object):'
149 149 """Build a new DirstateItem object from V2 data"""
150 150 has_mode_size = bool(flags & DIRSTATE_V2_HAS_MODE_AND_SIZE)
151 151 has_meaningful_mtime = bool(flags & DIRSTATE_V2_HAS_MTIME)
152 if flags & DIRSTATE_V2_MTIME_SECOND_AMBIGUOUS:
153 # The current code is not able to do the more subtle comparison that the
154 # MTIME_SECOND_AMBIGUOUS requires. So we ignore the mtime
155 has_meaningful_mtime = False
156 152 mode = None
157 153
158 154 if flags & +DIRSTATE_V2_EXPECTED_STATE_IS_MODIFIED:
@@ -179,13 +175,15 b' class DirstateItem(object):'
179 175 mode |= stat.S_IFLNK
180 176 else:
181 177 mode |= stat.S_IFREG
178
179 second_ambiguous = flags & DIRSTATE_V2_MTIME_SECOND_AMBIGUOUS
182 180 return cls(
183 181 wc_tracked=bool(flags & DIRSTATE_V2_WDIR_TRACKED),
184 182 p1_tracked=bool(flags & DIRSTATE_V2_P1_TRACKED),
185 183 p2_info=bool(flags & DIRSTATE_V2_P2_INFO),
186 184 has_meaningful_data=has_mode_size,
187 185 has_meaningful_mtime=has_meaningful_mtime,
188 parentfiledata=(mode, size, (mtime_s, mtime_ns, False)),
186 parentfiledata=(mode, size, (mtime_s, mtime_ns, second_ambiguous)),
189 187 fallback_exec=fallback_exec,
190 188 fallback_symlink=fallback_symlink,
191 189 )
@@ -371,11 +371,12 b' impl Node {'
371 371 let mtime = if self.flags().contains(Flags::HAS_MTIME)
372 372 && !self.flags().contains(Flags::DIRECTORY)
373 373 && !self.flags().contains(Flags::EXPECTED_STATE_IS_MODIFIED)
374 // The current code is not able to do the more subtle comparison that the
375 // MTIME_SECOND_AMBIGUOUS requires. So we ignore the mtime
376 && !self.flags().contains(Flags::MTIME_SECOND_AMBIGUOUS)
377 374 {
378 Some(self.mtime.try_into()?)
375 let mut m: TruncatedTimestamp = self.mtime.try_into()?;
376 if self.flags().contains(Flags::MTIME_SECOND_AMBIGUOUS) {
377 m.second_ambiguous = true;
378 }
379 Some(m)
379 380 } else {
380 381 None
381 382 };
General Comments 0
You need to be logged in to leave comments. Login now