Do not output unmodified files when resetting (fix)
[?]
Jan 10, 2021, 6:01 PM
VNBLGT6GAN2AHKRFKTKED7WNDDRGNULY5H343ZYV3ETSDZZKGBTACDependencies
- [2]
DJYHARZ7Skipping old files when recording - [3]
XA23FMQMReset only files that have been modified - [4]
VQPAUKBQchannel switch as an alias to reset - [5]
QYY37T6YFixing a panic with reset --dry-run and no input - [6]
WZVCLZKYaddress clippy lints - [7]
Y7YAFMFFFix path prefix striping on Windows. - [8]
I52XSRUHMassive cleanup, and simplification - [9]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [10]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [11]
QMTANHVNReset: only output changed files - [12]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [*]
VO5OQW4WRemoving anyhow in libpijul
Change contents
- replacement in pijul/src/commands/reset.rs at line 7
use libpijul::pristine::{ChangeId, Position};use libpijul::pristine::{ChangeId, ChannelMutTxnT, Position}; - replacement in pijul/src/commands/reset.rs at line 72[4.604]→[4.165:204](∅→∅),[4.204]→[3.65:145](∅→∅),[3.145]→[4.204:486](∅→∅),[4.204]→[4.204:486](∅→∅),[4.486]→[3.146:191](∅→∅),[3.191]→[4.486:545](∅→∅),[4.486]→[4.486:545](∅→∅)
if overwrite_changes {let last_modified = last_modified(&txn, &channel.borrow());txn.output_repository_no_pending(&mut repo.working_copy,&repo.changes,&mut channel,&mut HashMap::new(),"",true,Some(last_modified),)?;txn.commit()?;if !overwrite_changes {return Ok(()); - edit in pijul/src/commands/reset.rs at line 75
return Ok(()); - edit in pijul/src/commands/reset.rs at line 96
if self.channel.is_none() || self.channel.as_deref() == Some(current_channel) {let last_modified = last_modified(&txn, &channel.borrow());txn.output_repository_no_pending(&mut repo.working_copy,&repo.changes,&mut channel,&mut HashMap::new(),"",true,Some(last_modified),)?;txn.touch_channel(&mut channel.borrow_mut(), None);txn.commit()?;return Ok(());} - replacement in pijul/src/commands/record.rs at line 123
let oldest = std::time::SystemTime::now();let oldest = if let Ok(t) = oldest.duration_since(std::time::SystemTime::UNIX_EPOCH) {t.as_secs() as u64} else {0};txn.touch_channel(&mut channel.borrow_mut(), Some(oldest));txn.touch_channel(&mut channel.borrow_mut(), None); - replacement in libpijul/src/output/output.rs at line 187
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 {if needs_output(repo, if_modified_after, &path) { - edit in libpijul/src/output/output.rs at line 199
} else {debug!("Not outputting {:?}", path) - edit in libpijul/src/output/output.rs at line 231[14.21084][4.82825]
fn needs_output<R: WorkingCopy>(repo: &R, if_modified_after: Option<std::time::SystemTime>, path: &str) -> bool {if let Some(m) = if_modified_after {if let Ok(last) = repo.modified_time(path) {debug!("modified_after: {:?} {:?}", m, last);if let Ok(d) = last.duration_since(m) {return d.as_secs() > 0} else {return false}}}true}