Attributes path states to their destination path instead of their source path.
J4I5CGHR2653TYDOHXFJPUBGWHVDBKP74IE7JEPAJ44IY5JFNQNQC let change_contents = unrecorded_state.contents.lock();let new_inodes: HashMap<ChangePosition, Utf8PathBuf> = unrecorded_state.actions.iter().filter_map(|hunk| {if let Hunk::FileAdd {add_inode, path, ..} = hunk{// `add_inode` should always be Atom::NewVertexSome((add_inode.as_newvertex().start, Utf8PathBuf::from(path)))} else {None}}).collect();
let globalized_hunk = hunk.globalize(&*transaction.read())?;
let path = if let Hunk::FileMove { add, .. } = &hunk {let add_vertex = add.as_newvertex();let file_metadata = FileMetadata::read(&change_contents[add_vertex.start.0.as_usize()..add_vertex.end.0.as_usize()],);let parent_inode = add_vertex.inode;let current_parent_path = if let Some(change) = parent_inode.change {// Parent is already trackedlet (path, _is_alive) = libpijul::fs::find_path(change_store,&*transaction.read(),&*channel.read(),true,Position {change,pos: parent_inode.pos,},)?.unwrap();Utf8PathBuf::from(path)} else {// Parent is not yet trackednew_inodes.get(&parent_inode.pos).unwrap().to_path_buf()};current_parent_path.join(file_metadata.basename).to_string()} else {let globalized_hunk = hunk.clone().globalize(&*transaction.read())?;globalized_hunk.path().to_string()};
pub enum MovePathError<C: std::error::Error + 'static, W: std::error::Error + 'static> {#[error("Unable to begin transaction: {0}")]BeginTransaction(#[from] BeginTransactionError),#[error(transparent)]Sanakirja(#[from] SanakirjaError),#[error("Failed to move paths: {0}")]Move(#[from] libpijul::fs::FsError<MutTxn<()>>),#[error(transparent)]PathStates(#[from] PathStatesError<C, W>),}#[derive(Debug, thiserror::Error)]
&transaction,&channel,&self.working_copy.working_copy,&self.change_store,)?;Ok(())}pub fn move_path(&mut self,from_path: &Utf8Path,to_path: Utf8PathBuf,) -> Result<(), MovePathError<C::Error, W::Error>> {let move_transaction = self.pristine.arc_txn_begin()?;move_transaction.write().move_file(from_path.as_str(), to_path.as_str(), 0)?;move_transaction.commit()?;let (transaction, channel) = begin_transaction(&self.pristine)?;self.path_states.update_path_state(to_path,