When running `pijul apply` with stdin, immediately quit if the channel does not exist

pmeunier
May 21, 2023, 8:15 PM
ZDQB72IKN4RQEY4CGBOM56AW6DTOF7MEPLFADNZUGDZBELVCSXVAC

Dependencies

  • [2] RFLKHQ2Y First read all stdin when applying a patch, in order to avoid blocking
  • [3] 26VQKD25 A more accurate safeguard for apply, to check if the output is nondestructive
  • [4] A3RM526Y Integrating identity malleability
  • [5] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [*] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • edit in pijul/src/commands/apply.rs at line 32
    [2.1][2.1:407]()
    let mut hashes = Vec::new();
    if self.change.is_empty() {
    let mut change = std::io::BufReader::new(std::io::stdin());
    let mut change = libpijul::change::Change::read(&mut change, &mut HashMap::default())?;
    hashes.push(
    repo.changes
    .save_change(&mut change, |_, _| Ok::<_, anyhow::Error>(()))?,
    )
    }
  • edit in pijul/src/commands/apply.rs at line 50
    [7.195413]
    [3.0]
    let mut hashes = Vec::new();
    if self.change.is_empty() {
    let mut change = std::io::BufReader::new(std::io::stdin());
    let mut change = libpijul::change::Change::read(&mut change, &mut HashMap::default())?;
    hashes.push(
    repo.changes
    .save_change(&mut change, |_, _| Ok::<_, anyhow::Error>(()))?,
    )
    }