Show More
@@ -576,12 +576,13 b' impl DirstateEntry {' | |||||
576 | (self.state().into(), self.mode(), self.size(), self.mtime()) |
|
576 | (self.state().into(), self.mode(), self.size(), self.mtime()) | |
577 | } |
|
577 | } | |
578 |
|
578 | |||
579 | pub fn mtime_is_ambiguous(&self, now: i32) -> bool { |
|
579 | /// True if the stored mtime would be ambiguous with the current time | |
|
580 | pub fn need_delay(&self, now: i32) -> bool { | |||
580 | self.state() == EntryState::Normal && self.mtime() == now |
|
581 | self.state() == EntryState::Normal && self.mtime() == now | |
581 | } |
|
582 | } | |
582 |
|
583 | |||
583 | pub fn clear_ambiguous_mtime(&mut self, now: i32) -> bool { |
|
584 | pub fn clear_ambiguous_mtime(&mut self, now: i32) -> bool { | |
584 |
let ambiguous = self. |
|
585 | let ambiguous = self.need_delay(now); | |
585 | if ambiguous { |
|
586 | if ambiguous { | |
586 | // The file was last modified "simultaneously" with the current |
|
587 | // The file was last modified "simultaneously" with the current | |
587 | // write to dirstate (i.e. within the same second for file- |
|
588 | // write to dirstate (i.e. within the same second for file- |
@@ -947,7 +947,7 b' impl OwningDirstateMap {' | |||||
947 | node.full_path(map.on_disk)?, |
|
947 | node.full_path(map.on_disk)?, | |
948 | node.copy_source(map.on_disk)?, |
|
948 | node.copy_source(map.on_disk)?, | |
949 | ); |
|
949 | ); | |
950 |
if entry. |
|
950 | if entry.need_delay(now) { | |
951 | ambiguous_mtimes.push( |
|
951 | ambiguous_mtimes.push( | |
952 | node.full_path_borrowed(map.on_disk)? |
|
952 | node.full_path_borrowed(map.on_disk)? | |
953 | .detach_from_tree(), |
|
953 | .detach_from_tree(), | |
@@ -991,7 +991,7 b' impl OwningDirstateMap {' | |||||
991 | for node in map.iter_nodes() { |
|
991 | for node in map.iter_nodes() { | |
992 | let node = node?; |
|
992 | let node = node?; | |
993 | if let Some(entry) = node.entry()? { |
|
993 | if let Some(entry) = node.entry()? { | |
994 |
if entry. |
|
994 | if entry.need_delay(now) { | |
995 | paths.push( |
|
995 | paths.push( | |
996 | node.full_path_borrowed(map.on_disk)? |
|
996 | node.full_path_borrowed(map.on_disk)? | |
997 | .detach_from_tree(), |
|
997 | .detach_from_tree(), |
@@ -192,7 +192,7 b' py_class!(pub class DirstateItem |py| {' | |||||
192 | } |
|
192 | } | |
193 |
|
193 | |||
194 | def need_delay(&self, now: i32) -> PyResult<bool> { |
|
194 | def need_delay(&self, now: i32) -> PyResult<bool> { | |
195 |
Ok(self.entry(py).get(). |
|
195 | Ok(self.entry(py).get().need_delay(now)) | |
196 | } |
|
196 | } | |
197 |
|
197 | |||
198 | @classmethod |
|
198 | @classmethod |
General Comments 0
You need to be logged in to leave comments.
Login now