libpijul::fs::add_{file,dir} now return the created Inode
Dependencies
- [2]
HSEYMLO2Adding an untracked change iterator - [3]
RRCSHAYZFormatting - [4]
2RXOCWUWMaking libpijul deterministic (and getting rid of `rand`) - [5]
VO5OQW4WRemoving anyhow in libpijul - [6]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [7]
LCERQSWMCleanup - [8]
I24UEJQLVarious post-fire fixes - [9]
YN63NUZOSanakirja 1.0 - [10]
5SLOJYHGFixing the Git feature - [11]
V435QOJRUsing path-slash to fix path issues on Windows - [12]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting).
Change contents
- replacement in ""pijul/src/commands/git.rs"" at line 634
txn_.add_dir(&p, 0).unwrap_or(());txn_.add_dir(&p, 0).map(|_| ()).unwrap_or(()); - replacement in ""pijul/src/commands/git.rs"" at line 636
txn_.add_file(&p, 0).unwrap_or(());txn_.add_file(&p, 0).map(|_| ()).unwrap_or(()); - replacement in ""libpijul/src/working_copy/filesystem.rs"" at line 177
Ok(()) => {}Ok(_) => {} - replacement in ""libpijul/src/pristine/inode.rs"" at line 4
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)] - edit in ""libpijul/src/pristine/inode.rs"" at line 7
use std::str::FromStr; - edit in ""libpijul/src/pristine/inode.rs"" at line 21
}}impl FromStr for Inode {type Err = <u64 as FromStr>::Err;fn from_str(x: &str) -> Result<Self, Self::Err> {Ok(x.parse::<u64>()?.into())}}impl From<u64> for Inode {fn from(x: u64) -> Inode {Inode(x.into()) - edit in ""libpijul/src/pristine/inode.rs"" at line 36[3.644428]
impl From<Inode> for u64 {fn from(x: Inode) -> u64 {x.0.into()}} - replacement in ""libpijul/src/lib.rs"" at line 217
fn add_file(&mut self, path: &str, salt: u64) -> Result<(), fs::FsError<Self::GraphError>> {fn add_file(&mut self, path: &str, salt: u64) -> Result<Inode, fs::FsError<Self::GraphError>> { - replacement in ""libpijul/src/lib.rs"" at line 225
fn add_dir(&mut self, path: &str, salt: u64) -> Result<(), fs::FsError<Self::GraphError>> {fn add_dir(&mut self, path: &str, salt: u64) -> Result<Inode, fs::FsError<Self::GraphError>> { - replacement in ""libpijul/src/lib.rs"" at line 237
) -> Result<(), fs::FsError<Self::GraphError>> {) -> Result<Inode, fs::FsError<Self::GraphError>> { - edit in ""libpijul/src/fs.rs"" at line 31
#[error("Invalid path: {0}")]InvalidPath(String), - replacement in ""libpijul/src/fs.rs"" at line 240
pub(crate) fn add_inode<T: TreeMutTxnT>(pub fn add_inode<T: TreeMutTxnT>( - replacement in ""libpijul/src/fs.rs"" at line 246
) -> Result<(), FsError<T::TreeError>> {) -> Result<Inode, FsError<T::TreeError>> { - edit in ""libpijul/src/fs.rs"" at line 259
Ok(current_inode)} else {Err(FsError::InvalidPath(path.to_string())) - edit in ""libpijul/src/fs.rs"" at line 263
Ok(())