Skipping old files when recording
[?]
Jan 10, 2021, 5:10 PM
DJYHARZ7CSRMX6ZFM6P52SM2EC57VTSHWAIMFSD7Q3EL7UYZGLXQCDependencies
- [2]
7FFFKQZUadd 'Default' implementations - [3]
GHO6DWPIRefactoring iterators - [4]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [5]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [6]
CCFJ7VO3Renaming "Record" to "Hunk" in the changes - [7]
O4DNWMPDCleaunp and proofreading of libpijul::record - [8]
ZHABNS3SCanonicalize all paths - [9]
KQTD46KVUnrecord: restore files *after* having unapplied the *entire* change - [10]
VO5OQW4WRemoving anyhow in libpijul - [11]
6YMDOZIBRefactoring apply - [*]
I52XSRUHMassive cleanup, and simplification
Change contents
- edit in pijul/src/commands/record.rs at line 11[4.101876][13.2137]
use libpijul::pristine::ChannelMutTxnT; - replacement in pijul/src/commands/record.rs at line 96
if let Some((mut change, updates, hash)) = result {if let Some((mut change, updates, hash, oldest)) = result { - edit in pijul/src/commands/record.rs at line 115
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)); - edit 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.commit()?; - edit in pijul/src/commands/record.rs at line 183[13.2303][4.106865]
std::time::SystemTime, - replacement in pijul/src/commands/record.rs at line 264
Ok(Some((change, rec.updatables, Some(hash))))Ok(Some((change,rec.updatables,Some(hash),rec.oldest_change,))) - replacement in libpijul/src/unrecord/mod.rs at line 209
T::touch_channel(channel, Some(0));txn.touch_channel(channel, Some(0)); - edit in libpijul/src/record.rs at line 65
#[derive(Default)] - edit in libpijul/src/record.rs at line 77
/// Timestamp of the oldest changed file. If nothing changed,/// returns now().pub oldest_change: std::time::SystemTime, - replacement in libpijul/src/record.rs at line 85
rec: Recorded::default(),rec: Recorded {contents: Vec::new(),actions: Vec::new(),updatables: HashMap::new(),largest_file: 0,has_binary_files: false,oldest_change: std::time::SystemTime::now(),}, - replacement in libpijul/src/record.rs at line 97
force_rediff: true,force_rediff: false, - replacement in libpijul/src/record.rs at line 426
|| modified_since_last_commit::<T, _>(&channel, working_copy, &item.full_path)?)|| self.modified_since_last_commit::<T, _>(&channel, working_copy, &item.full_path)?) - edit in libpijul/src/record.rs at line 445
if self.rec.actions.len() > len {if let Ok(last_modified) = working_copy.modified_time(&item.full_path) {self.rec.oldest_change = self.rec.oldest_change.min(last_modified);}} - edit in libpijul/src/record.rs at line 599
} - replacement in libpijul/src/record.rs at line 600[4.506855]→[4.35714:35777](∅→∅),[4.35777]→[3.29319:29345](∅→∅),[3.29345]→[4.506992:507032](∅→∅),[4.506992]→[4.506992:507032](∅→∅),[4.507032]→[4.12447:12495](∅→∅),[4.12495]→[4.507067:507318](∅→∅),[4.507067]→[4.507067:507318](∅→∅),[4.507318]→[3.29346:29384](∅→∅),[3.29384]→[4.507352:507479](∅→∅),[4.507352]→[4.507352:507479](∅→∅),[4.507479]→[3.29385:29427](∅→∅),[3.29427]→[4.507517:507547](∅→∅),[4.507517]→[4.507517:507547](∅→∅)
fn modified_since_last_commit<T: ChannelTxnT, W: WorkingCopy>(channel: &T::Channel,working_copy: &W,prefix: &str,) -> Result<bool, std::time::SystemTimeError> {if let Ok(last_modified) = working_copy.modified_time(prefix) {debug!("last_modified = {:?}, channel.last = {:?}",last_modified.duration_since(std::time::UNIX_EPOCH)?.as_secs(),T::last_modified(channel));Ok(last_modified.duration_since(std::time::UNIX_EPOCH)?.as_secs()+ 2>= T::last_modified(channel))} else {Ok(true)fn modified_since_last_commit<T: ChannelTxnT, W: WorkingCopy>(&mut self,channel: &T::Channel,working_copy: &W,prefix: &str,) -> Result<bool, std::time::SystemTimeError> {if let Ok(last_modified) = working_copy.modified_time(prefix) {debug!("last_modified = {:?}, channel.last = {:?}",last_modified.duration_since(std::time::UNIX_EPOCH)?.as_secs(),T::last_modified(channel));Ok(last_modified.duration_since(std::time::UNIX_EPOCH)?.as_secs()+ 2>= T::last_modified(channel))} else {Ok(true)} - replacement in libpijul/src/pristine/sanakirja.rs at line 1399
fn touch_channel(channel: &mut Self::Channel, t: Option<u64>) {fn touch_channel(&mut self, channel: &mut Self::Channel, t: Option<u64>) { - replacement in libpijul/src/pristine/mod.rs at line 1342
fn touch_channel(channel: &mut Self::Channel, t: Option<u64>);fn touch_channel(&mut self, channel: &mut Self::Channel, t: Option<u64>); - edit in libpijul/src/apply.rs at line 291
T::touch_channel(channel, None);