Also drive-by refactor it in the other DirstateMap
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Also drive-by refactor it in the other DirstateMap
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | rust/hg-core/src/dirstate/dirstate_map.rs (17 lines) | |||
M | rust/hg-core/src/dirstate_tree/dirstate_map.rs (14 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
59014bc4f73a | 52d07ac9ffec | Simon Sapin | Apr 12 2021, 12:42 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Abandoned | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin |
// dirstate_map.rs | // dirstate_map.rs | ||||
// | // | ||||
// Copyright 2019 Raphaël Gomès <rgomes@octobus.net> | // Copyright 2019 Raphaël Gomès <rgomes@octobus.net> | ||||
// | // | ||||
// This software may be used and distributed according to the terms of the | // This software may be used and distributed according to the terms of the | ||||
// GNU General Public License version 2 or any later version. | // GNU General Public License version 2 or any later version. | ||||
use crate::dirstate::parsers::clear_ambiguous_mtime; | |||||
use crate::dirstate::parsers::Timestamp; | use crate::dirstate::parsers::Timestamp; | ||||
use crate::errors::HgError; | use crate::errors::HgError; | ||||
use crate::revlog::node::NULL_NODE; | use crate::revlog::node::NULL_NODE; | ||||
use crate::{ | use crate::{ | ||||
dirstate::{parsers::PARENT_SIZE, EntryState, SIZE_FROM_OTHER_PARENT}, | dirstate::{parsers::PARENT_SIZE, EntryState, SIZE_FROM_OTHER_PARENT}, | ||||
pack_dirstate, parse_dirstate, | pack_dirstate, parse_dirstate, | ||||
utils::{ | utils::{ | ||||
files::normalize_case, | files::normalize_case, | ||||
} | } | ||||
pub fn clear_ambiguous_times( | pub fn clear_ambiguous_times( | ||||
&mut self, | &mut self, | ||||
filenames: Vec<HgPathBuf>, | filenames: Vec<HgPathBuf>, | ||||
now: i32, | now: i32, | ||||
) { | ) { | ||||
for filename in filenames { | for filename in filenames { | ||||
let mut changed = false; | |||||
if let Some(entry) = self.state_map.get_mut(&filename) { | if let Some(entry) = self.state_map.get_mut(&filename) { | ||||
if entry.state == EntryState::Normal && entry.mtime == now { | if clear_ambiguous_mtime(entry, now) { | ||||
changed = true; | |||||
*entry = DirstateEntry { | |||||
mtime: MTIME_UNSET, | |||||
..*entry | |||||
}; | |||||
} | |||||
} | |||||
if changed { | |||||
self.get_non_normal_other_parent_entries() | self.get_non_normal_other_parent_entries() | ||||
.0 | .0 | ||||
.insert(filename.to_owned()); | .insert(filename.to_owned()); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | |||||
pub fn non_normal_entries_remove( | pub fn non_normal_entries_remove( | ||||
&mut self, | &mut self, | ||||
key: impl AsRef<HgPath>, | key: impl AsRef<HgPath>, | ||||
) -> bool { | ) -> bool { | ||||
self.get_non_normal_other_parent_entries() | self.get_non_normal_other_parent_entries() | ||||
.0 | .0 | ||||
.remove(key.as_ref()) | .remove(key.as_ref()) |
fn drop_file( | fn drop_file( | ||||
&mut self, | &mut self, | ||||
_filename: &HgPath, | _filename: &HgPath, | ||||
_old_state: EntryState, | _old_state: EntryState, | ||||
) -> Result<bool, DirstateMapError> { | ) -> Result<bool, DirstateMapError> { | ||||
todo!() | todo!() | ||||
} | } | ||||
fn clear_ambiguous_times( | fn clear_ambiguous_times(&mut self, filenames: Vec<HgPathBuf>, now: i32) { | ||||
&mut self, | for filename in filenames { | ||||
_filenames: Vec<HgPathBuf>, | if let Some(node) = Self::get_node_mut(&mut self.root, &filename) { | ||||
_now: i32, | if let Some(entry) = node.entry.as_mut() { | ||||
) { | clear_ambiguous_mtime(entry, now); | ||||
todo!() | } | ||||
} | |||||
} | |||||
} | } | ||||
fn non_normal_entries_contains(&mut self, _key: &HgPath) -> bool { | fn non_normal_entries_contains(&mut self, _key: &HgPath) -> bool { | ||||
todo!() | todo!() | ||||
} | } | ||||
fn non_normal_entries_remove(&mut self, _key: &HgPath) -> bool { | fn non_normal_entries_remove(&mut self, _key: &HgPath) -> bool { | ||||
todo!() | todo!() |