Reset only files that have been modified

[?]
Jan 10, 2021, 5:40 PM
XA23FMQM2AI7RMR36AYN7UNP2D5JWVJMJPHURWZO7URM7H46PU6AC

Dependencies

  • [2] QMTANHVN Reset: only output changed files
  • [3] R3H7D42U Debugging `pijul git`: proper error reporting
  • [4] VO5OQW4W Removing anyhow in libpijul
  • [5] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [6] I52XSRUH Massive cleanup, and simplification
  • [7] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [8] 3KRGVQFU Do not update the mtime of unmodified files
  • [9] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [*] 5DVRL6MF Hard-unrecord
  • [*] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)

Change contents

  • edit in pijul/src/remote/ssh.rs at line 913
    [3.236]
    [3.236]
    None,
  • edit in pijul/src/remote/local.rs at line 135
    [3.470]
    [3.470]
    None,
  • edit in pijul/src/commands/unrecord.rs at line 127
    [11.1358]
    [11.1358]
    None,
  • edit in pijul/src/commands/reset.rs at line 73
    [2.204]
    [2.204]
    let last_modified = last_modified(&txn, &channel.borrow());
  • edit in pijul/src/commands/reset.rs at line 81
    [2.486]
    [2.486]
    Some(last_modified),
  • edit in pijul/src/commands/reset.rs at line 141
    [2.2033]
    [2.2033]
    None,
  • edit in pijul/src/commands/reset.rs at line 156
    [3.101631]
    [3.101631]
    None,
  • edit in pijul/src/commands/reset.rs at line 198
    [2.2837]
    [3.101744]
    }
    fn last_modified<T: ChannelTxnT>(_: &T, channel: &T::Channel) -> std::time::SystemTime {
    std::time::SystemTime::UNIX_EPOCH + std::time::Duration::from_secs(T::last_modified(channel))
  • edit in pijul/src/commands/pushpull.rs at line 461
    [12.10419]
    [12.10419]
    None,
  • edit in pijul/src/commands/protocol.rs at line 244
    [3.133493]
    [3.133493]
    None,
  • edit in pijul/src/commands/clone.rs at line 104
    [3.185766]
    [3.185766]
    None,
  • replacement in pijul/src/commands/apply.rs at line 1
    [3.194289][3.3306:3337]()
    use std::collections::HashMap;
    [3.194289]
    [3.3337]
    use std::collections::{HashMap, HashSet};
  • replacement in pijul/src/commands/apply.rs at line 7
    [3.194383][3.6485:6528]()
    use libpijul::{MutTxnT, MutTxnTExt, TxnT};
    [3.194383]
    [3.3379]
    use libpijul::{DepsTxnT, GraphTxnT, MutTxnT, MutTxnTExt, TxnT};
  • replacement in pijul/src/commands/apply.rs at line 60
    [3.196137][3.196137:196268](),[3.196268][3.1927:1960](),[3.1960][3.196268:196314](),[3.196268][3.196268:196314]()
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    &mut HashMap::new(),
    "",
    true,
    )?;
    [3.196137]
    [3.196314]
    let mut touched = HashSet::new();
    for d in hashes.iter() {
    if let Some(int) = txn.get_internal(*d)? {
    for inode in txn.iter_rev_touched(int)? {
    let (int_, inode) = inode?;
    if int_ < int {
    continue;
    } else if int_ > int {
    break;
    }
    touched.insert(inode);
    }
    }
    }
    let mut done = HashMap::new();
    for i in touched {
    let (path, _) =
    libpijul::fs::find_path(&repo.changes, &txn, &channel.borrow(), false, i)?;
    txn.output_repository_no_pending(
    &mut repo.working_copy,
    &repo.changes,
    &mut channel,
    &mut done,
    &path,
    true,
    None,
    )?;
    }
  • edit in libpijul/src/output/output.rs at line 38
    [3.673225]
    [3.81906]
    if_modified_since: Option<std::time::SystemTime>,
  • edit in libpijul/src/output/output.rs at line 49
    [3.673474]
    [3.673474]
    if_modified_since,
  • edit in libpijul/src/output/output.rs at line 68
    [3.673828]
    [3.82075]
    if_modified_after: Option<std::time::SystemTime>,
  • replacement in libpijul/src/output/output.rs at line 187
    [3.678511][3.678511:678585](),[3.678585][3.20516:20886]()
    repo.write_file(&path, |w: &mut dyn std::io::Write| {
    output_file::<_, _, R>(
    txn,
    channel,
    changes,
    &output_item,
    &mut conflicts,
    w,
    )
    })
    .map_err(OutputError::from)?
    [3.678511]
    [3.678702]
    let output = if let Some(m) = if_modified_after {
    if let Ok(last) = repo.modified_time(&path) {
    last >= m
    } else {
    true
    }
    } else {
    true
    };
    if output {
    repo.write_file(&path, |w: &mut dyn std::io::Write| {
    output_file::<_, _, R>(
    txn,
    channel,
    changes,
    &output_item,
    &mut conflicts,
    w,
    )
    })
    .map_err(OutputError::from)?
    }
  • edit in libpijul/src/lib.rs at line 276
    [3.725733]
    [3.94684]
    if_modified_since: Option<std::time::SystemTime>
  • edit in libpijul/src/lib.rs at line 287
    [3.725968]
    [3.725968]
    if_modified_since,