Apply: proper error message when the change is not found

[?]
May 6, 2021, 6:00 AM
TYTQGSKZTHRGBOD6HQGK3VWWPXYXT5JONXYOV65ZO4O3HT7MBUNQC

Dependencies

  • [2] YN63NUZO Sanakirja 1.0
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] R3H7D42U Debugging `pijul git`: proper error reporting
  • [5] 5SLOJYHG Fixing the Git feature

Change contents

  • replacement in pijul/src/commands/apply.rs at line 45
    [3.195560][3.195560:195640]()
    let change = libpijul::change::Change::deserialize(&ch, None)?;
    [3.195560]
    [3.195640]
    let change = libpijul::change::Change::deserialize(&ch, None);
    let change = match change {
    Ok(change) => change,
    Err(libpijul::change::ChangeError::Io(e)) => {
    if let std::io::ErrorKind::NotFound = e.kind() {
    let extra = if std::path::Path::new(&ch).is_relative() {
    " Using the full path to the change file may help."
    } else {
    ""
    };
    bail!("File {} not found, and not recognised as a prefix of a known change identifier.{}", ch, extra)
    } else {
    return Err(e.into())
    }
    }
    Err(e) => return Err(e.into())
    };
  • replacement in pijul/src/commands/apply.rs at line 79
    [2.14342][3.1302:1376](),[3.1302][3.1302:1376]()
    txn.apply_change_rec(&repo.changes, &mut channel, hash)?;
    [2.14342]
    [3.1376]
    txn.apply_change_rec(&repo.changes, &mut channel, hash)?