Fix in output
Dependencies
- [2]
3QXUJMZDMore detailed display of conflicts - [3]
PEUUYRZ5Order of removing paths when outputting a repo - [4]
UFCZKKLXUpgrading to the latest Sanakirja/Rand - [5]
H6JR7IAFFixing a panic when outputting zombie folders - [6]
YCEZL7VFMoving to temporary paths when outputting - [7]
5BRU2RRWCleanup (debugging a crash related to trees/inodes) - [8]
4RQHY7LHSupport parsing lowercase base32 - [9]
HBUMCAFVAvoid printing multiple names conflicts more than once - [10]
RRCSHAYZFormatting - [11]
VO5OQW4WRemoving anyhow in libpijul - [12]
2RXOCWUWMaking libpijul deterministic (and getting rid of `rand`) - [13]
FXEDPLRIResurrecting tests, and type cleanup (no need for Arc<RwLock<…>> anymore) - [14]
I24UEJQLVarious post-fire fixes - [15]
GJZWSXHQDo not remove files not tracked in the new channel when outputting - [16]
RMDMAYRXAdding a root inode (aka supporting submodules) - [17]
YN63NUZOSanakirja 1.0 - [18]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [19]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [20]
ZDK3GNDBTag transactions (including a massive refactoring of errors) - [*]
VNBLGT6GDo not output unmodified files when resetting (fix)
Change contents
- replacement in libpijul/src/output/output.rs at line 7
use crate::fs::{create_new_inode, inode_filename};use crate::fs::create_new_inode; - replacement in libpijul/src/output/output.rs at line 258
move_map: HashMap::new(), - replacement in libpijul/src/output/output.rs at line 321
for (a, b) in state.actual_moves.iter() {// Since we did a depth-first search of the output paths, we need// to move in reverse order of the search.for (a, b) in state.actual_moves.iter().rev() {debug!("actual move: {:?} {:?}", a, b); - edit in libpijul/src/output/output.rs at line 366
move_map: HashMap<Inode, String>, - replacement in libpijul/src/output/output.rs at line 398
collect_dead_files::<_, R, P>(&*txn_, graph, self.pending_change_id, Inode::ROOT)?collect_dead_files::<_, R, P>(&*txn_,graph,&self.move_map,self.pending_change_id,Inode::ROOT,)? - edit in libpijul/src/output/output.rs at line 529
&mut self.move_map, - edit in libpijul/src/output/output.rs at line 555
debug!("next_files {:?}", next_files); - edit in libpijul/src/output/output.rs at line 617[22.1501][22.1501]
use std::borrow::Cow; - edit in libpijul/src/output/output.rs at line 629
move_map: &mut HashMap<Inode, String>, - replacement in libpijul/src/output/output.rs at line 643[4.103023]→[4.79838:79911](∅→∅),[4.79838]→[4.79838:79911](∅→∅),[4.79911]→[4.680438:680552](∅→∅),[4.83144]→[4.680438:680552](∅→∅),[4.680438]→[4.680438:680552](∅→∅)
if let Some(ref current_name) = inode_filename(&*txn_, inode)? {debug!("current_name = {:?}, path = {:?}", current_name, path);if current_name != path {if let Some(ref current_name) = inode_filename(&*txn_, inode, move_map)? {let actual_path = if let Some(tmp) = tmp.take() {Cow::Owned(tmp)} else {Cow::Borrowed(path)};debug!("current_name = {:?}, path = {:?}, actual_path = {:?}",current_name, path, actual_path);if current_name.as_str() != &actual_path { - edit in libpijul/src/output/output.rs at line 660
let mut tmp_path = path.to_string();crate::path::pop(&mut tmp_path); - edit in libpijul/src/output/output.rs at line 665
crate::path::push(&mut tmp_path, &s);repo.rename(¤t_name, &tmp_path).map_err(OutputError::WorkingCopy)?; - edit in libpijul/src/output/output.rs at line 667
// The parent was already moveddebug!("tmp {:?}", tmp);crate::path::pop(tmp); - edit in libpijul/src/output/output.rs at line 671
} else {*tmp = Some(tmp_path.clone()); - replacement in libpijul/src/output/output.rs at line 672
actual_moves.push((tmp_path, path.to_string()));let mut tmp_ = actual_path.to_string();crate::path::pop(&mut tmp_);crate::path::push(&mut tmp_, &s);debug!("rename {:?} {:?}", current_name, tmp_);repo.rename(¤t_name, &tmp_).map_err(OutputError::WorkingCopy)?;move_map.insert(inode, tmp_.to_string());actual_moves.push((tmp_.to_string(), actual_path.to_string()));*tmp = Some(tmp_); - edit in libpijul/src/output/output.rs at line 836
move_map: &HashMap<Inode, String>, - replacement in libpijul/src/output/output.rs at line 867
dead.insert(id.to_owned(), (*inode_, inode_filename(txn, *inode_)?));dead.insert(id.to_owned(),(*inode_, inode_filename(txn, *inode_, move_map)?),); - replacement in libpijul/src/output/output.rs at line 893
let cmp = b.1.1.cmp(&a.1.1);let cmp = b.1 .1.cmp(&a.1 .1); - edit in libpijul/src/output/output.rs at line 927
}fn inode_filename<T: TreeTxnT>(txn: &T,inode: Inode,tmp: &HashMap<Inode, String>,) -> Result<Option<String>, TreeErr<T::TreeError>> {debug!("inode_filename {:?}", inode);let mut components = Vec::new();let mut current = inode;loop {if let Some(tmp) = tmp.get(¤t) {components.push(SmallString::from_str(tmp));break;}match txn.get_revtree(¤t, None)? {Some(v) => {components.push(v.basename.to_owned());current = v.parent_inode;if current == Inode::ROOT {break;}}None => {debug!("filename_of_inode: not in tree");return Ok(None);}}}let mut path = String::new();for c in components.iter().rev() {if !path.is_empty() {path.push('/')}path.push_str(c.as_str());}debug!("inode_filename = {:?}", path);Ok(Some(path))