Cleanup and formatting

[?]
May 27, 2021, 10:05 AM
GUL4M5FIE7JYXJHR7MCTQS3543HIQXGPLBWZKASBAWWEA4SZ75CAC

Dependencies

  • [2] F6V27C3M Fixing the "old file optimisation" in record, after the move to parallelisable records
  • [3] NS36CJCO Validating timestamps in record
  • [4] HWH4WWN3 Proper separation of Git commit messages into a message and description fields in changes
  • [5] AAXP2534 Tags: completing the subcommand
  • [6] PEUQPKDH Fixing a warning in pijul credit
  • [7] 3H6Q5LDS Fixing a bug with the salt argument in `mv`
  • [8] YN63NUZO Sanakirja 1.0
  • [9] YDTN6BGI Touch the channel if no file was changed
  • [10] K7JPP64S Faster error in unrecord when the change is not on the channel
  • [11] 7MNTFTDF Exit with an error when a change could not be signed
  • [12] KWAGWB73 Adding extra dependencies from the config file
  • [13] GBLM3JLR Fix options of git subcommand
  • [14] MF3WAHBI commands/record: amend current change if unspecified
  • [15] AXVPNZ2N commands/git: fix imports
  • [16] BXD3IQYN Fixing --features git
  • [17] 6RVT5X4L Current state: return zero instead of an Option if there is no change on the channel
  • [18] QL6K2ZM3 Tags
  • [19] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [20] 3FTEGCMR add timestamp_validator to tag --timestamp option
  • [21] I52XSRUH Massive cleanup, and simplification
  • [22] OWCCRVO5 Fixing a broken pipe in credit
  • [23] 3MHUNYER Changing --amend flag to respect -m flag
  • [24] I24UEJQL Various post-fire fixes
  • [25] 2RXOCWUW Making libpijul deterministic (and getting rid of `rand`)
  • [26] DJYHARZ7 Skipping old files when recording
  • [27] ZHABNS3S Canonicalize all paths
  • [28] CVAT6LN3 Fixing git import, and adding more useful feedback (with `RUST_LOG="pijul=info"`)
  • [29] B3QWIGDE Fixing the Git features with the latest Pijul (+ conflicts in Cargo.toml)
  • [30] L2LPPKD4 Fixing the Git feature
  • [31] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [32] IIV3EL2X Cleanup, formatting, and fixing the Git feature
  • [33] 5SLOJYHG Fixing the Git feature
  • [34] V435QOJR Using path-slash to fix path issues on Windows
  • [35] A3DMBJJA Upgrading the `git` subcommand to the latest Sanakirja and Libpijul
  • [36] L4JXJHWX pijul/*: reorganize imports and remove extern crate

Change contents

  • replacement in pijul/src/commands/unrecord.rs at line 132
    [8.998][8.117:196]()
    txn.write().unwrap().unrecord(&repo.changes, &channel, &hash, 0)?;
    [8.998]
    [8.5477]
    txn.write()
    .unwrap()
    .unrecord(&repo.changes, &channel, &hash, 0)?;
  • replacement in pijul/src/commands/unrecord.rs at line 151
    [8.5939][8.217:293]()
    txn.write().unwrap().unrecord(&repo.changes, &channel, &h, 0)?;
    [8.5939]
    [8.6012]
    txn.write()
    .unwrap()
    .unrecord(&repo.changes, &channel, &h, 0)?;
  • replacement in pijul/src/commands/tag.rs at line 120
    [5.268][5.268:440]()
    let channel_name = repo
    .config
    .get_current_channel(None)
    .0
    .to_string();
    [5.268]
    [5.440]
    let channel_name = repo.config.get_current_channel(None).0.to_string();
  • replacement in pijul/src/commands/record.rs at line 60
    [3.230][3.230:256]()
    return Ok(())
    [3.230]
    [3.256]
    return Ok(());
  • replacement in pijul/src/commands/record.rs at line 117
    [8.282][8.390:486]()
    txn.unrecord(&repo.changes, &mut channel, &h, self.timestamp.unwrap_or(0) as u64)?;
    [8.282]
    [8.103981]
    txn.unrecord(
    &repo.changes,
    &mut channel,
    &h,
    self.timestamp.unwrap_or(0) as u64,
    )?;
  • replacement in pijul/src/commands/record.rs at line 149
    [8.104255][2.0:24]()
    match result {
    [8.104255]
    [2.24]
    match result {
  • replacement in pijul/src/commands/record.rs at line 287
    [8.106731][2.2754:2771]()
    Either<(
    [8.106731]
    [8.13881]
    Either<
    (
    Arc<RwLock<T>>,
    Change,
    HashMap<usize, libpijul::InodeUpdate>,
    Option<libpijul::Hash>,
    std::time::SystemTime,
    ),
  • replacement in pijul/src/commands/record.rs at line 296
    [8.132][8.106748:106819](),[8.13909][8.106748:106819](),[8.106748][8.106748:106819](),[8.106819][8.2267:2303](),[8.2303][8.714:749](),[8.749][2.2772:2800]()
    Change,
    HashMap<usize, libpijul::InodeUpdate>,
    Option<libpijul::Hash>,
    std::time::SystemTime,
    ), Arc<RwLock<T>>>,
    [8.13909]
    [8.106877]
    >,
  • replacement in pijul/src/commands/record.rs at line 435
    [2.2895][2.2895:2904]()
    B(B)
    [2.2895]
    [2.2904]
    B(B),
  • edit in pijul/src/commands/git.rs at line 1
    [8.137210]
    [8.137281]
    use anyhow::bail;
    use canonical_path::CanonicalPathBuf;
    use clap::{ArgSettings, Clap};
    use libpijul::pristine::*;
    use libpijul::*;
    use log::{debug, error, info, trace};
  • edit in pijul/src/commands/git.rs at line 13
    [8.843][8.0:18](),[8.2237][8.0:18](),[8.18][8.160:198](),[8.2237][8.160:198](),[8.198][8.0:31](),[8.2237][8.0:31](),[8.31][8.0:27](),[8.16][8.0:27](),[8.27][8.2264:2281](),[8.2264][8.2264:2281](),[8.2281][8.17:55]()
    use anyhow::bail;
    use canonical_path::CanonicalPathBuf;
    use clap::{ArgSettings, Clap};
    use libpijul::pristine::*;
    use libpijul::*;
    use log::{debug, error, info, trace};
  • replacement in pijul/src/commands/git.rs at line 329
    [8.146777][8.1369:1472]()
    let state = import_commit(git, repo, txn.clone(), channel.clone(), &oid, &mut stats)?;
    [8.146777]
    [8.146874]
    let state =
    import_commit(git, repo, txn.clone(), channel.clone(), &oid, &mut stats)?;
  • replacement in pijul/src/commands/git.rs at line 571
    [8.1756][8.3118:3221]()
    if let Some(old_path) = libpijul::fs::inode_filename(&*txn, *inode)? {
    [8.1756]
    [8.154875]
    if let Some(old_path) = libpijul::fs::inode_filename(&*txn, *inode)?
    {
  • replacement in pijul/src/commands/git.rs at line 663
    [8.158287][8.3627:3705]()
    debug!("recording on channel {:?}", txn_.name(&channel.read().unwrap()));
    [8.158287]
    [8.158352]
    debug!(
    "recording on channel {:?}",
    txn_.name(&channel.read().unwrap())
    );
  • replacement in pijul/src/commands/git.rs at line 703
    [8.158961][4.399:487]()
    description: if description.is_empty() { None } else { Some(description) },
    [8.158961]
    [8.158992]
    description: if description.is_empty() {
    None
    } else {
    Some(description)
    },
  • replacement in pijul/src/commands/git.rs at line 747
    [8.160373][8.4245:4382]()
    fn record_apply<T: TxnT + TxnTExt + MutTxnTExt + Send + Sync + 'static, C: libpijul::changestore::ChangeStore + Clone + Send + 'static>(
    [8.160373]
    [8.4382]
    fn record_apply<
    T: TxnT + TxnTExt + MutTxnTExt + Send + Sync + 'static,
    C: libpijul::changestore::ChangeStore + Clone + Send + 'static,
    >(
  • replacement in pijul/src/commands/git.rs at line 789
    [8.1447][8.5038:5112]()
    txn.current_state(&channel.read().unwrap()).map_err(TxnErr)?,
    [8.1447]
    [8.1514]
    txn.current_state(&channel.read().unwrap())
    .map_err(TxnErr)?,
  • replacement in pijul/src/commands/file_operations.rs at line 6
    [8.647][7.0:31]()
    use clap::{Clap, ArgSettings};
    [8.647]
    [8.4127]
    use clap::{ArgSettings, Clap};
  • replacement in pijul/src/commands/credit.rs at line 61
    [8.58][8.58:83]()
    Ok(_) => {},
    [8.58]
    [6.0]
    Ok(_) => {}
  • replacement in pijul/src/commands/credit.rs at line 65
    [6.151][6.151:193]()
    return Err(io.into())
    [6.151]
    [6.193]
    return Err(io.into());
  • replacement in pijul/src/commands/credit.rs at line 67
    [6.211][6.211:226]()
    },
    [6.211]
    [8.143]
    }
  • edit in pijul/src/commands/credit.rs at line 140
    [8.182206]
    [8.182206]
    let st: u64 = v.start.into();
    write!(self.w, "{}.{} > ", v.change.to_base32(), st)?;
  • edit in libpijul/src/pristine/sanakirja.rs at line 1409
    [8.50063][8.2889:2997](),[8.2997][8.63728:64393](),[8.63728][8.63728:64393]()
    // self.counter += 1;
    // debug!("put_graph {:?} {:?}, counter = {:?}", k, e, self.counter);
    /*
    if self.counter >= 12965 {
    let mut x = None;
    let mut cursor = btree::cursor::Cursor::new(&self.txn, graph)?;
    let mut panic = None;
    while let Some((k, v)) = cursor.next(&self.txn)? {
    if let Some((ref k_, ref v_)) = x {
    if k_ > k || (k_== k && v_ > v) {
    panic = Some((*k, *v));
    break
    }
    }
    x = Some((*k, *v))
    }
    self.debug(graph, ".put");
    if panic.is_some() {
    panic!("{:?}", x);
    }
    }
    */
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1418
    [8.50114][8.2998:3106](),[8.3106][8.64496:66261](),[8.64496][8.64496:66261]()
    // self.counter += 1;
    // debug!("del_graph {:?} {:?}, counter = {:?}", k, e, self.counter);
    /*
    if self.counter >= 12965 {
    let mut x = None;
    let mut cursor = btree::cursor::Cursor::new(&self.txn, graph)?;
    let mut panic = None;
    while let Some((k, v)) = cursor.next(&self.txn)? {
    if let Some((ref k_, ref v_)) = x {
    if k_ > k || (k_== k && v_ > v) {
    panic = Some((*k, *v));
    break
    }
    }
    x = Some((*k, *v))
    }
    self.debug(graph, ".del");
    if panic.is_some() {
    panic!("{:?}", x);
    }
    }
    let change = ChangeId::from_base32(b"MM6XEY5S32WRA").unwrap();
    let mm6v = Vertex {
    change,
    start: ChangePosition(L64(1478218)),
    end: ChangePosition(L64(1478229)),
    };
    let mm6e = (Edge {
    flag: EdgeFlags::BLOCK | EdgeFlags::FOLDER | EdgeFlags::PARENT,
    dest: Position {
    change,
    pos: ChangePosition(L64(1466149)),
    },
    introduced_by: change,
    }).into();
    let has_mm6 = if let Some((v, e)) = btree::get(&self.txn, graph, &mm6v, Some(&mm6e)).unwrap() {
    v == &mm6v && e == &mm6e
    } else {
    false
    };
    */
    let result = Ok(btree::del(&mut self.txn, graph, k, e)?);
    /*
    if has_mm6 && (k != &mm6v || e != Some(&mm6e)) {
    if let Some((v, e)) = btree::get(&self.txn, graph, &mm6v, Some(&mm6e)).unwrap() {
    assert_eq!(v, &mm6v);
    assert_eq!(e, &mm6e)
    } else {
    panic!("Not found")
    }
    }
    */
    result
    [8.50114]
    [8.66261]
    Ok(btree::del(&mut self.txn, graph, k, e)?)