Debugging `pijul git`: proper error reporting

[?]
Dec 2, 2020, 2:24 PM
R3H7D42UZ446V5TO2574BMAQQAYYJPEIMSZVDPAGVIYU2COJSWBAC

Dependencies

  • [2] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [3] 7UPL3Y2A Unrecord: don't restore the same unrecorded file deletion twice in the inodes and tree tables
  • [4] KWAMD2KR A few fixes in the documentation comments
  • [5] AEPEFS7O Write help for each argument
  • [6] I52XSRUH Massive cleanup, and simplification
  • [7] 4H2XTVJ2 Fix some mistakes in the docs
  • [8] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [9] YDKNUL6B Add `diff --short` that lists changes without showing them

Change contents

  • edit in pijul/src/commands/git.rs at line 287
    [5.146114]
    [5.146114]
    debug!(
    "fork channel: {:?} {:?}",
    parent_channel.borrow().name(),
    name
    );
  • replacement in pijul/src/commands/git.rs at line 693
    [5.160881][5.160881:160972]()
    working_copy.record_prefixes(txn, channel, changes, &mut state, repo_path, prefixes)?;
    [5.160881]
    [5.160972]
    for p in prefixes.iter() {
    let result = working_copy.record_prefix(txn, channel, changes, &mut state, repo_path, p);
    if let Err(e) = result {
    match e.downcast() {
    Ok(libpijul::Error::FileNotInRepo { .. }) => {}
    Ok(e) => return Err(e.into()),
    Err(e) => return Err(e),
    }
    }
    }
  • edit in pijul/src/commands/apply.rs at line 4
    [2.3362]
    [2.3362]
    use anyhow::bail;
  • edit in pijul/src/commands/apply.rs at line 10
    [2.3415][2.3415:3433]()
    use crate::Error;
  • replacement in pijul/src/commands/apply.rs at line 19
    [5.194664][4.4007:4082]()
    /// Only apply the dependencies of this change, not the change itself.
    [5.194664]
    [5.194664]
    /// Only apply the dependencies of the change, not the change itself. Only applicable for a single change.
  • replacement in pijul/src/commands/apply.rs at line 23
    [4.4207][5.194717:194745](),[5.6080][5.194717:194745](),[5.194717][5.194717:194745]()
    change: Option<String>,
    [4.4207]
    [5.194745]
    change: Vec<String>,
  • edit in pijul/src/commands/apply.rs at line 33
    [5.195153][5.195153:195250]()
    } else if self.change.is_some() {
    txn.open_or_create_channel(&channel_name)?
  • replacement in pijul/src/commands/apply.rs at line 34
    [5.195267][5.195267:195402]()
    return Err((Error::NoSuchChannel {
    channel: channel_name.to_string(),
    })
    .into());
    [5.195267]
    [5.195402]
    txn.open_or_create_channel(&channel_name)?
  • replacement in pijul/src/commands/apply.rs at line 36
    [5.195413][5.195413:195519]()
    let hash = if let Some(ch) = self.change {
    if let Ok(h) = txn.hash_from_prefix(&ch) {
    [5.195413]
    [5.195519]
    let mut hashes = Vec::new();
    for ch in self.change.iter() {
    hashes.push(if let Ok(h) = txn.hash_from_prefix(ch) {
  • replacement in pijul/src/commands/apply.rs at line 43
    [5.195691][5.195691:195722]()
    }
    } else {
    [5.195691]
    [5.195722]
    })
    }
    if hashes.is_empty() {
  • replacement in pijul/src/commands/apply.rs at line 48
    [5.195886][5.195886:195944]()
    repo.changes.save_change(&change)?
    };
    [5.195886]
    [5.195944]
    hashes.push(repo.changes.save_change(&change)?)
    }
  • replacement in pijul/src/commands/apply.rs at line 51
    [5.195972][5.195972:196040]()
    txn.apply_deps_rec(&repo.changes, &mut channel, hash)?;
    [5.195972]
    [5.196040]
    if hashes.len() > 1 {
    bail!("--deps-only is only applicable to a single change")
    }
    txn.apply_deps_rec(&repo.changes, &mut channel, hashes.pop().unwrap())?;
  • replacement in pijul/src/commands/apply.rs at line 56
    [5.196057][5.196057:196127]()
    txn.apply_change_rec(&repo.changes, &mut channel, hash)?;
    [5.196057]
    [5.196127]
    for hash in hashes.drain(..) {
    txn.apply_change_rec(&repo.changes, &mut channel, hash)?;
    }
  • replacement in libpijul/src/working_copy/filesystem.rs at line 60
    [5.210511][5.210511:210695]()
    if let Err(e) =
    self.record_prefix(txn, channel, changes, state, repo_path, prefix.as_ref())
    {
    eprintln!("{}", e)
    }
    [5.210511]
    [5.210695]
    self.record_prefix(txn, channel, changes, state, repo_path, prefix.as_ref())?
  • replacement in libpijul/src/working_copy/filesystem.rs at line 63
    [5.210738][5.210738:210920]()
    if let Err(e) =
    self.record_prefix(txn, channel, changes, state, repo_path, Path::new(""))
    {
    eprintln!("{}", e)
    }
    [5.210738]
    [5.210920]
    self.record_prefix(txn, channel, changes, state, repo_path, Path::new(""))?
  • replacement in libpijul/src/unrecord/working_copy.rs at line 102
    [3.259][3.259:338]()
    txn.put_inodes(inode, dest)?;
    txn.put_revinodes(dest, inode)?;
    [3.259]
    [3.338]
    put_inodes_with_rev(txn, inode, dest)?;
  • edit in libpijul/src/record.rs at line 481
    [5.506695]
    [5.506695]
    debug!("comp = {:?}", comp);
  • replacement in libpijul/src/output/output.rs at line 258
    [5.681620][5.681620:681737]()
    txn.put_inodes(inode, output_item.pos)?;
    txn.put_revinodes(output_item.pos, inode)?;
    [5.681620]
    [5.681737]
    put_inodes_with_rev(txn, inode, output_item.pos)?;
  • replacement in libpijul/src/output/output.rs at line 267
    [5.682097][5.682097:682206]()
    txn.put_inodes(inode, output_item.pos)?;
    txn.put_revinodes(output_item.pos, inode)?;
    [5.682097]
    [5.682206]
    put_inodes_with_rev(txn, inode, output_item.pos)?;
  • replacement in libpijul/src/output/output.rs at line 282
    [5.682701][5.682701:682802]()
    txn.put_inodes(inode, output_item.pos)?;
    txn.put_revinodes(output_item.pos, inode)?;
    [5.682701]
    [5.682802]
    put_inodes_with_rev(txn, inode, output_item.pos)?;