libpijul::fs::add_{file,dir} now return the created Inode

pmeunier
Sep 9, 2021, 12:30 PM
YGPEHOTED5UG3IUK263PIX566VEHM3KYHPYIXZHPJ4ICHXWZEUJAC

Dependencies

  • [2] HSEYMLO2 Adding an untracked change iterator
  • [3] I24UEJQL Various post-fire fixes
  • [4] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [5] V435QOJR Using path-slash to fix path issues on Windows
  • [6] LCERQSWM Cleanup
  • [7] 2RXOCWUW Making libpijul deterministic (and getting rid of `rand`)
  • [8] VO5OQW4W Removing anyhow in libpijul
  • [9] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [10] 5SLOJYHG Fixing the Git feature
  • [11] RRCSHAYZ Formatting
  • [12] YN63NUZO Sanakirja 1.0

Change contents

  • replacement in ""pijul/src/commands/git.rs"" at line 634
    [3.158004][3.1057:1108]()
    txn_.add_dir(&p, 0).unwrap_or(());
    [3.158004]
    [3.158068]
    txn_.add_dir(&p, 0).map(|_| ()).unwrap_or(());
  • replacement in ""pijul/src/commands/git.rs"" at line 636
    [3.158089][3.1109:1161]()
    txn_.add_file(&p, 0).unwrap_or(());
    [3.158089]
    [3.158154]
    txn_.add_file(&p, 0).map(|_| ()).unwrap_or(());
  • replacement in ""libpijul/src/working_copy/filesystem.rs"" at line 177
    [2.3975][2.3975:4004]()
    Ok(()) => {}
    [2.3975]
    [2.4004]
    Ok(_) => {}
  • replacement in ""libpijul/src/pristine/inode.rs"" at line 4
    [3.643809][3.643809:643870]()
    #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
    [3.643809]
    [3.3392]
    #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)]
  • edit in ""libpijul/src/pristine/inode.rs"" at line 7
    [3.2687]
    [3.643917]
    use std::str::FromStr;
  • edit in ""libpijul/src/pristine/inode.rs"" at line 21
    [3.644347]
    [3.644420]
    }
    }
    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
    [3.726194][3.4274:4371]()
    fn add_file(&mut self, path: &str, salt: u64) -> Result<(), fs::FsError<Self::GraphError>> {
    [3.726194]
    [3.4371]
    fn add_file(&mut self, path: &str, salt: u64) -> Result<Inode, fs::FsError<Self::GraphError>> {
  • replacement in ""libpijul/src/lib.rs"" at line 225
    [3.726545][3.4425:4521]()
    fn add_dir(&mut self, path: &str, salt: u64) -> Result<(), fs::FsError<Self::GraphError>> {
    [3.726545]
    [3.4521]
    fn add_dir(&mut self, path: &str, salt: u64) -> Result<Inode, fs::FsError<Self::GraphError>> {
  • replacement in ""libpijul/src/lib.rs"" at line 237
    [3.3255][3.3255:3308]()
    ) -> Result<(), fs::FsError<Self::GraphError>> {
    [3.3255]
    [3.4680]
    ) -> Result<Inode, fs::FsError<Self::GraphError>> {
  • edit in ""libpijul/src/fs.rs"" at line 31
    [3.101630]
    [3.101630]
    #[error("Invalid path: {0}")]
    InvalidPath(String),
  • replacement in ""libpijul/src/fs.rs"" at line 240
    [3.17][3.104285:104326]()
    pub(crate) fn add_inode<T: TreeMutTxnT>(
    [3.17]
    [3.744705]
    pub fn add_inode<T: TreeMutTxnT>(
  • replacement in ""libpijul/src/fs.rs"" at line 246
    [3.5552][3.104327:104368](),[3.744782][3.104327:104368]()
    ) -> Result<(), FsError<T::TreeError>> {
    [3.5552]
    [3.744815]
    ) -> Result<Inode, FsError<T::TreeError>> {
  • edit in ""libpijul/src/fs.rs"" at line 259
    [3.5717]
    [3.745446]
    Ok(current_inode)
    } else {
    Err(FsError::InvalidPath(path.to_string()))
  • edit in ""libpijul/src/fs.rs"" at line 263
    [3.745452][3.745452:745463]()
    Ok(())