[Updated] D10489: dirstate-tree: Add clear_ambiguous_times in the new DirstateMap
SimonSapin
phabricator at mercurial-scm.org
Thu May 6 16:52:58 UTC 2021
Closed by commit rHGb613addd1d24: dirstate-tree: Add clear_ambiguous_times in the new DirstateMap (authored by SimonSapin).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D10489?vs=27139&id=27649
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10489/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10489
AFFECTED FILES
rust/hg-core/src/dirstate/dirstate_map.rs
rust/hg-core/src/dirstate_tree/dirstate_map.rs
CHANGE DETAILS
diff --git a/rust/hg-core/src/dirstate_tree/dirstate_map.rs b/rust/hg-core/src/dirstate_tree/dirstate_map.rs
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs
@@ -287,12 +287,14 @@
todo!()
}
- fn clear_ambiguous_times(
- &mut self,
- _filenames: Vec<HgPathBuf>,
- _now: i32,
- ) {
- todo!()
+ fn clear_ambiguous_times(&mut self, filenames: Vec<HgPathBuf>, now: i32) {
+ for filename in filenames {
+ if let Some(node) = Self::get_node_mut(&mut self.root, &filename) {
+ if let Some(entry) = node.entry.as_mut() {
+ clear_ambiguous_mtime(entry, now);
+ }
+ }
+ }
}
fn non_normal_entries_contains(&mut self, _key: &HgPath) -> bool {
diff --git a/rust/hg-core/src/dirstate/dirstate_map.rs b/rust/hg-core/src/dirstate/dirstate_map.rs
--- a/rust/hg-core/src/dirstate/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs
@@ -5,6 +5,7 @@
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
+use crate::dirstate::parsers::clear_ambiguous_mtime;
use crate::dirstate::parsers::Timestamp;
use crate::errors::HgError;
use crate::revlog::node::NULL_NODE;
@@ -188,21 +189,13 @@
now: i32,
) {
for filename in filenames {
- let mut changed = false;
if let Some(entry) = self.state_map.get_mut(&filename) {
- if entry.state == EntryState::Normal && entry.mtime == now {
- changed = true;
- *entry = DirstateEntry {
- mtime: MTIME_UNSET,
- ..*entry
- };
+ if clear_ambiguous_mtime(entry, now) {
+ self.get_non_normal_other_parent_entries()
+ .0
+ .insert(filename.to_owned());
}
}
- if changed {
- self.get_non_normal_other_parent_entries()
- .0
- .insert(filename.to_owned());
- }
}
}
To: SimonSapin, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210506/641de625/attachment-0001.html>
More information about the Mercurial-patches
mailing list