Checking that `pijul apply` does not destroy unrecorded changes
Dependencies
- [2]
C4MJ7D7QVerbose printing of conflicts to stderr - [3]
5NHRJ5PYCleaner handling of binary changes in the text format - [4]
I2D35LLFMore accurate recording of modification time - [5]
I24UEJQLVarious post-fire fixes - [6]
YDTN6BGITouch the channel if no file was changed - [7]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [*]
F6V27C3MFixing the "old file optimisation" in record, after the move to parallelisable records - [*]
2D7P2VKJChange completions (where the whole progress bar story started)
Change contents
- edit in pijul/src/commands/record.rs at line 360
}if rec.has_binary_files {bail!("Cannot record a binary change interactively. Please use -a.") - edit in pijul/src/commands/record.rs at line 365
- replacement in pijul/src/commands/record.rs at line 419
if rec.has_binary_files {bail!("Cannot record a binary change interactively. Please use -a.")} else {bail!("Cannot parse change")}bail!("Cannot parse change") - edit in pijul/src/commands/apply.rs at line 133[10.5339][2.3127]
{let mut state = libpijul::RecordBuilder::new();if touched_files.is_empty() {state.record(txn.clone(),libpijul::Algorithm::default(),false,&libpijul::DEFAULT_SEPARATOR,channel.clone(),&repo.working_copy,&repo.changes,"",num_cpus::get(),)?} else {use canonical_path::CanonicalPathBuf;fill_relative_prefixes(&mut touched_files)?;repo.working_copy.record_prefixes(txn.clone(),channel.clone(),&repo.changes,&mut state,CanonicalPathBuf::canonicalize(&repo.path)?,&touched_files,false,num_cpus::get(),0,)?;}let rec = state.finish();if !rec.actions.is_empty() {bail!("Applying this patch would delete unrecorded changes, aborting")}} - edit in pijul/src/commands/apply.rs at line 208
}}fn fill_relative_prefixes(prefixes: &mut [String]) -> Result<Vec<PathBuf>, anyhow::Error> {let cwd = std::env::current_dir()?;let mut pref = Vec::new();for p in prefixes.iter_mut() {if std::path::Path::new(p).is_relative() {pref.push(cwd.join(&p));} - edit in pijul/src/commands/apply.rs at line 219
Ok(pref)