Returning an error when recording non-existent paths

[?]
Apr 29, 2021, 5:28 PM
G7VOM2IMN4SOHOOCFLMNPKTU5DB5EEJMK7SSBA3DLWWXFA672RUAC

Dependencies

  • [2] I24UEJQL Various post-fire fixes
  • [3] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [4] 4VWXL6KQ Correct handling of ignore files
  • [5] 4OCC6D42 Recursive add
  • [6] VO5OQW4W Removing anyhow in libpijul
  • [7] JP3BYVXX Fixing file paths on Windows
  • [8] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [9] ZHABNS3S Canonicalize all paths
  • [10] OJZWJUF2 MUCH faster `pijul add -r`

Change contents

  • replacement in pijul/src/commands/file_operations.rs at line 146
    [3.340][3.462:561](),[3.561][3.807:861](),[3.807][3.807:861](),[3.861][2.19641:19678](),[2.19678][3.895:1065](),[3.895][3.895:1065](),[3.320][3.538:556](),[3.1065][3.538:556](),[3.538][3.538:556]()
    if let Ok((full, prefix)) = get_prefix(Some(repo_path.as_ref()), path.as_path()) {
    repo.working_copy.add_prefix_rec(
    txn.clone(),
    repo_path.clone(),
    full.clone(),
    &prefix,
    threads,
    )?
    }
    [3.340]
    [3.172084]
    let (full, _) = get_prefix(Some(repo_path.as_ref()), path.as_path())?;
    repo.working_copy.add_prefix_rec(
    txn.clone(),
    repo_path.clone(),
    full.clone(),
    threads,
    )?
  • edit in libpijul/src/working_copy/filesystem.rs at line 143
    [3.1825][3.1770:1792](),[3.1770][3.1770:1792]()
    prefix: &str,
  • edit in libpijul/src/working_copy/filesystem.rs at line 145
    [3.3867][3.1829:1875](),[3.19679][3.1829:1875](),[3.1829][3.1829:1875]()
    debug!("record_prefix {:?}", prefix);
  • replacement in libpijul/src/working_copy/filesystem.rs at line 238
    [3.19819][3.2643:2726](),[2.28457][3.2643:2726](),[3.3917][3.2643:2726](),[3.2726][2.28458:28540](),[3.2800][3.213590:213648](),[3.3206][3.213590:213648](),[3.3802][3.213590:213648](),[2.28540][3.213590:213648](),[3.213590][3.213590:213648](),[3.213648][2.28541:28596](),[2.28596][3.213695:213837](),[3.213695][3.213695:213837](),[3.213837][2.28597:28616](),[2.28616][3.213837:213895](),[3.213837][3.213837:213895]()
    if let Ok((full, prefix)) = get_prefix(Some(repo_path.as_ref()), prefix) {
    self.add_prefix_rec(txn.clone(), repo_path, full, &prefix, threads)?;
    debug!("recording from prefix {:?}", prefix);
    state.record(
    txn.clone(),
    crate::Algorithm::default(),
    channel,
    self,
    changes,
    &prefix,
    1,
    )?;
    debug!("recorded");
    }
    [2.28457]
    [3.213895]
    let (full, prefix) = get_prefix(Some(repo_path.as_ref()), prefix).map_err(AddError::Io)?;
    self.add_prefix_rec(txn.clone(), repo_path, full, threads)?;
    debug!("recording from prefix {:?}", prefix);
    state.record(
    txn.clone(),
    crate::Algorithm::default(),
    channel,
    self,
    changes,
    &prefix,
    1,
    )?;
    debug!("recorded");