Archive: set the accurate and deterministic mtime

[?]
Jan 8, 2021, 11:03 AM
I3OVP3NHSMB2YLU4EPU5BFH7KB54PMQ4WDATGINIJKRIHMSVFUSQC

Dependencies

  • [2] GHO6DWPI Refactoring iterators
  • [3] VO5OQW4W Removing anyhow in libpijul
  • [4] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [5] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • replacement in libpijul/src/output/archive.rs at line 10
    [3.25035][3.690250:690318](),[3.690250][3.690250:690318]()
    fn create_file(&mut self, path: &str, perm: u16) -> Self::File;
    [3.25035]
    [3.25036]
    fn create_file(&mut self, path: &str, mtime: u64, perm: u16) -> Self::File;
  • edit in libpijul/src/output/archive.rs at line 26
    [3.690687]
    [3.690687]
    mtime: u64,
  • replacement in libpijul/src/output/archive.rs at line 55
    [3.25142][3.691376:691452](),[3.691376][3.691376:691452]()
    fn create_file(&mut self, path: &str, permissions: u16) -> Self::File {
    [3.25142]
    [3.691452]
    fn create_file(&mut self, path: &str, mtime: u64, permissions: u16) -> Self::File {
  • edit in libpijul/src/output/archive.rs at line 64
    [3.691727]
    [3.691727]
    mtime,
  • edit in libpijul/src/output/archive.rs at line 73
    [3.692031]
    [3.692031]
    header.set_mtime(file.mtime);
  • replacement in libpijul/src/output/archive.rs at line 118
    [3.87842][3.87842:87862]()
    T: ChannelTxnT,
    [3.87842]
    [3.87862]
    T: ChannelTxnT + DepsTxnT<DepsError = <T as GraphTxnT>::GraphError>,
  • edit in libpijul/src/output/archive.rs at line 191
    [3.694891]
    [3.694891]
    let mut latest_touch = 0;
    let mut latest_change = 0;
    for c in txn.iter_touched(output_item.pos)? {
    let (inode, change) = c?;
    if inode < output_item.pos {
    continue;
    } else if inode > output_item.pos {
    break;
    }
    if let Some(t) = txn.get_changeset(T::changes(&channel), change)? {
    if t > latest_change || latest_touch == 0 {
    latest_change = t;
    let ext = txn.get_external(change)?.unwrap();
    let c = changes.get_header(&ext).map_err(ArchiveError::P)?;
    latest_touch = c.timestamp.timestamp() as u64
    }
    }
    }
  • edit in libpijul/src/output/archive.rs at line 221
    [3.695326]
    [2.58791]
    debug!("latest_touch: {:?}", latest_touch);
  • replacement in libpijul/src/output/archive.rs at line 223
    [2.58890][3.695414:695503](),[3.88373][3.695414:695503](),[3.695414][3.695414:695503]()
    let mut f = arch.create_file(&path, output_item.meta.permissions());
    [2.58890]
    [3.695503]
    let mut f =
    arch.create_file(&path, latest_touch, output_item.meta.permissions());