Formatting/Cleanup

pmeunier
Oct 19, 2021, 11:30 AM
XGH2A4BOZGNLDBVWOZNWODSJSTU4VCTNLP25T3LNXJUQBS2FDIUQC

Dependencies

  • [2] NUAOEIXM Adding inode and byte to Local
  • [3] M2C6QW2A Avoid serialising twice in order to save the changes' signatures
  • [4] FINWDBLQ Moving back to zstd-seekable 0.1
  • [5] 6YMDOZIB Refactoring apply
  • [6] RRCSHAYZ Formatting
  • [7] SMMBFECL Converting to the new patch format "online"
  • [8] I24UEJQL Various post-fire fixes
  • [9] 6T5ULULM Fixing conflicts with the changes from discussion #143
  • [10] COYHX6OR Minor formatting
  • [11] CSMXGT2L Init zstd_seekable
  • [12] VO5OQW4W Removing anyhow in libpijul
  • [13] WZVCLZKY address clippy lints
  • [14] 2RXOCWUW Making libpijul deterministic (and getting rid of `rand`)
  • [15] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [16] ZSF3YFZT encoded file deletion
  • [17] AD6M434O find_alive performance (matters a lot for unrecord)
  • [18] 3QGE6HRD Version bump (upgrade to zstd-seekable 0.2, take 2)
  • [19] CBVGAARC Slightly more generic libpijul::change::Hunk
  • [20] FSNBD6GK Debugging information and Cargo.lock updates (attempting to measure and solve #468)
  • [*] YN63NUZO Sanakirja 1.0
  • [*] G734WNM6 flake.nix: use crate2nix
  • [*] XAY4DYRR Version bump

Change contents

  • edit in "shell.nix" at line 7
    [22.116]
    [22.116]
    xxHash
  • edit in "libpijul/src/lib.rs" at line 77
    [5.83668]
    [5.4030]
    #[cfg(feature = "deterministic_hash")]
  • edit in "libpijul/src/lib.rs" at line 79
    [5.4100]
    [5.2918]
    #[cfg(not(feature = "deterministic_hash"))]
    pub type Hasher = std::collections::hash_map::RandomState;
  • edit in "libpijul/src/lib.rs" at line 84
    [5.3044][5.83890:84088](),[5.4189][5.83890:84088](),[5.83890][5.83890:84088]()
    // pub type HashMap<K, V> = std::collections::HashMap<K, V, std::collections::hash_map::RandomState>;
    // pub type HashSet<K> = std::collections::HashSet<K, std::collections::hash_map::RandomState>;
  • edit in "libpijul/src/find_alive.rs" at line 101
    [5.881][5.881:928]()
    stack.truncate(elt_index);
  • replacement in "libpijul/src/changestore/mod.rs" at line 7
    [5.4262][3.1033:1082]()
    change::{Change, ChangeHeader, ChangeError},
    [5.4262]
    [5.4298]
    change::{Change, ChangeError, ChangeHeader},
  • replacement in "libpijul/src/changestore/memory.rs" at line 95
    [5.823259][3.1296:1455]()
    fn save_change<E: From<Self::Error> + From<ChangeError>, F: FnOnce(&mut Change, &Hash) -> Result<(), E>>(&self, p: &mut Change, f: F) -> Result<Hash, E> {
    [5.823259]
    [5.823330]
    fn save_change<
    E: From<Self::Error> + From<ChangeError>,
    F: FnOnce(&mut Change, &Hash) -> Result<(), E>,
    >(
    &self,
    p: &mut Change,
    f: F,
    ) -> Result<Hash, E> {
  • replacement in "libpijul/src/changestore/filesystem.rs" at line 202
    [5.830156][3.1543:1703]()
    fn save_change<E: From<Self::Error> + From<ChangeError>, F: FnOnce(&mut Change, &Hash) -> Result<(), E>>(&self, p: &mut Change, ff: F) -> Result<Hash, E> {
    [5.830156]
    [3.1703]
    fn save_change<
    E: From<Self::Error> + From<ChangeError>,
    F: FnOnce(&mut Change, &Hash) -> Result<(), E>,
    >(
    &self,
    p: &mut Change,
    ff: F,
    ) -> Result<Hash, E> {
  • replacement in "libpijul/src/changestore/filesystem.rs" at line 212
    [3.1806][3.1806:1864]()
    Err(e) => return Err(E::from(Error::from(e)))
    [3.1806]
    [3.1864]
    Err(e) => return Err(E::from(Error::from(e))),
  • replacement in "libpijul/src/changestore/filesystem.rs" at line 220
    [3.1988][3.1988:2036]()
    return Err(E::from(Error::from(e)))
    [3.1988]
    [3.2036]
    return Err(E::from(Error::from(e)));
  • replacement in "libpijul/src/changestore/filesystem.rs" at line 224
    [3.2094][3.2094:2142]()
    return Err(E::from(Error::from(e)))
    [3.2094]
    [3.2142]
    return Err(E::from(Error::from(e)));
  • replacement in "libpijul/src/change.rs" at line 1219
    [2.2466][2.2466:2519]()
    |l| Local { path: l.path, line: l.line }
    [2.2466]
    [2.2519]
    |l| Local {
    path: l.path,
    line: l.line,
    },
  • replacement in "libpijul/src/change.rs" at line 1336
    [5.870081][3.2153:2300]()
    pub fn serialize<W: Write, E: From<ChangeError>, F: FnOnce(&mut Self, &Hash) -> Result<(), E>>(&mut self, mut w: W, f: F) -> Result<Hash, E> {
    [5.870081]
    [5.870244]
    pub fn serialize<
    W: Write,
    E: From<ChangeError>,
    F: FnOnce(&mut Self, &Hash) -> Result<(), E>,
    >(
    &mut self,
    mut w: W,
    f: F,
    ) -> Result<Hash, E> {
  • replacement in "libpijul/src/change.rs" at line 1378
    [5.871342][3.2410:2507]()
    debug!("compressed {:?} bytes of contents in {:?}", self.contents.len(), now.elapsed());
    [5.871342]
    [5.6559]
    debug!(
    "compressed {:?} bytes of contents in {:?}",
    self.contents.len(),
    now.elapsed()
    );
  • replacement in "libpijul/src/change/change_file.rs" at line 87
    [5.92372][4.59:116](),[4.116][5.75:195](),[5.75][5.75:195](),[5.195][4.117:134]()
    Some(zstd_seekable::Seekable::init(Box::new(
    OffFile {
    f: r,
    start: offsets.contents_off,
    },
    ))?)
    [5.92372]
    [5.92523]
    Some(zstd_seekable::Seekable::init(Box::new(OffFile {
    f: r,
    start: offsets.contents_off,
    }))?)
  • replacement in "libpijul/src/alive/tarjan.rs" at line 30
    [5.983388][5.983388:983491]()
    for j in i..self[n_l].n_children {
    let &(_, n_child) = self.child(n_l, j);
    [5.983388]
    [5.983491]
    for j in i..self[n_l].n_children + self[n_l].extra.len() {
    let n_child = if j < self[n_l].n_children {
    self.child(n_l, j).1
    } else {
    self[n_l].extra[j - self[n_l].n_children].1
    };
  • replacement in "libpijul/src/alive/mod.rs" at line 146
    [5.998115][5.998115:998356]()
    for (_, child) in graph.children(p) {
    if graph[p].scc < target_scc && graph[p].scc != graph[*child].scc {
    assert!(graph[p].scc > graph[*child].scc);
    vertices.remove(&graph[*child].vertex);
    [5.998115]
    [5.998356]
    for &(_, child) in graph.children(p) {
    if graph[p].scc < target_scc && graph[p].scc != graph[child].scc {
    assert!(graph[p].scc > graph[child].scc);
    vertices.remove(&graph[child].vertex);
  • replacement in "libpijul/src/alive/mod.rs" at line 151
    [5.998370][5.998370:998448]()
    if graph[*child].scc >= min {
    stack.push(*child);
    [5.998370]
    [5.998448]
    if graph[child].scc >= min {
    stack.push(child);
  • replacement in "libpijul/src/alive/mod.rs" at line 198
    [5.999894][5.999894:1000027]()
    for (_, child) in graph.children(p) {
    if graph[*child].scc >= min {
    stack.push((*child, false));
    [5.999894]
    [5.1000027]
    for &(_, child) in graph.children(p) {
    if graph[child].scc >= min {
    stack.push((child, false));
  • replacement in "libpijul/src/alive/mod.rs" at line 203
    [5.1000082][5.1000082:1000204]()
    && graph[*child].scc != graph[p].scc
    && covered.contains(&(graph[*child].vertex, target))
    [5.1000082]
    [5.1000204]
    && graph[child].scc != graph[p].scc
    && covered.contains(&(graph[child].vertex, target))
  • replacement in "libpijul/src/alive/mod.rs" at line 206
    [5.1000218][5.1000218:1000277]()
    assert!(graph[*child].scc < graph[p].scc);
    [5.1000218]
    [5.1000277]
    assert!(graph[child].scc < graph[p].scc);
  • edit in "flake.nix" at line 86
    [23.247162]
    [24.125]
    xxHash