##// 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 static PyObject *dirstate_item_from_v2_m
450 dirstate_flag_has_meaningful_data |
450 dirstate_flag_has_meaningful_data |
451 dirstate_flag_has_mtime);
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 t->mode = 0;
453 t->mode = 0;
462 if (t->flags & dirstate_flag_has_meaningful_data) {
454 if (t->flags & dirstate_flag_has_meaningful_data) {
463 if (t->flags & dirstate_flag_mode_exec_perm) {
455 if (t->flags & dirstate_flag_mode_exec_perm) {
@@ -149,10 +149,6 class DirstateItem(object):
149 """Build a new DirstateItem object from V2 data"""
149 """Build a new DirstateItem object from V2 data"""
150 has_mode_size = bool(flags & DIRSTATE_V2_HAS_MODE_AND_SIZE)
150 has_mode_size = bool(flags & DIRSTATE_V2_HAS_MODE_AND_SIZE)
151 has_meaningful_mtime = bool(flags & DIRSTATE_V2_HAS_MTIME)
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 mode = None
152 mode = None
157
153
158 if flags & +DIRSTATE_V2_EXPECTED_STATE_IS_MODIFIED:
154 if flags & +DIRSTATE_V2_EXPECTED_STATE_IS_MODIFIED:
@@ -179,13 +175,15 class DirstateItem(object):
179 mode |= stat.S_IFLNK
175 mode |= stat.S_IFLNK
180 else:
176 else:
181 mode |= stat.S_IFREG
177 mode |= stat.S_IFREG
178
179 second_ambiguous = flags & DIRSTATE_V2_MTIME_SECOND_AMBIGUOUS
182 return cls(
180 return cls(
183 wc_tracked=bool(flags & DIRSTATE_V2_WDIR_TRACKED),
181 wc_tracked=bool(flags & DIRSTATE_V2_WDIR_TRACKED),
184 p1_tracked=bool(flags & DIRSTATE_V2_P1_TRACKED),
182 p1_tracked=bool(flags & DIRSTATE_V2_P1_TRACKED),
185 p2_info=bool(flags & DIRSTATE_V2_P2_INFO),
183 p2_info=bool(flags & DIRSTATE_V2_P2_INFO),
186 has_meaningful_data=has_mode_size,
184 has_meaningful_data=has_mode_size,
187 has_meaningful_mtime=has_meaningful_mtime,
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 fallback_exec=fallback_exec,
187 fallback_exec=fallback_exec,
190 fallback_symlink=fallback_symlink,
188 fallback_symlink=fallback_symlink,
191 )
189 )
@@ -371,11 +371,12 impl Node {
371 let mtime = if self.flags().contains(Flags::HAS_MTIME)
371 let mtime = if self.flags().contains(Flags::HAS_MTIME)
372 && !self.flags().contains(Flags::DIRECTORY)
372 && !self.flags().contains(Flags::DIRECTORY)
373 && !self.flags().contains(Flags::EXPECTED_STATE_IS_MODIFIED)
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 } else {
380 } else {
380 None
381 None
381 };
382 };
General Comments 0
You need to be logged in to leave comments. Login now