Recording a prefix we just deleted (mostly useful in `pijul git`, regular records returned NotFound)
Dependencies
- [2]
Z7J55B4PFix the concatenation of repository root and file when recording - [3]
HSEYMLO2Adding an untracked change iterator - [4]
I24UEJQLVarious post-fire fixes - [5]
4OCC6D42Recursive add - [6]
G7VOM2IMReturning an error when recording non-existent paths - [7]
2RXOCWUWMaking libpijul deterministic (and getting rid of `rand`) - [8]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [9]
VO5OQW4WRemoving anyhow in libpijul - [10]
ZHABNS3SCanonicalize all paths - [*]
A3DMBJJAUpgrading the `git` subcommand to the latest Sanakirja and Libpijul
Change contents
- edit in pijul/src/commands/git.rs at line 506
} else {*reset_was_useful_.borrow_mut() = true - edit in pijul/src/commands/git.rs at line 737[12.1006][4.160829]
debug!("record_apply {:?}", prefixes); - edit in pijul/src/commands/file_operations.rs at line 143
let full = CanonicalPathBuf::new(&full)?; - replacement in libpijul/src/working_copy/filesystem.rs at line 45
repo_path: Option<&CanonicalPath>,repo_path: Option<&Path>, - replacement in libpijul/src/working_copy/filesystem.rs at line 47
) -> Result<(canonical_path::CanonicalPathBuf, String), std::io::Error> {) -> Result<(PathBuf, String), std::io::Error> { - replacement in libpijul/src/working_copy/filesystem.rs at line 50
Cow::Borrowed(repo)Cow::Borrowed(repo.into()) - replacement in libpijul/src/working_copy/filesystem.rs at line 52
Cow::Owned(canonical_path::CanonicalPathBuf::canonicalize(std::env::current_dir()?,)?)Cow::Owned(std::env::current_dir()?) - replacement in libpijul/src/working_copy/filesystem.rs at line 55
let prefix_ = CanonicalPathBuf::canonicalize(&repo.as_path().join(&prefix))?;let repo_prefix = &repo.join(&prefix);let prefix_ = if let Ok(x) = repo_prefix.canonicalize() {x} else {let mut p = PathBuf::new();for c in repo_prefix.components() {use std::path::Component;match c {Component::Prefix(_) => p.push(c.as_os_str()),Component::RootDir => p.push(c.as_os_str()),Component::CurDir => {},Component::ParentDir => { p.pop(); },Component::Normal(x) => p.push(x),}}p}; - replacement in libpijul/src/working_copy/filesystem.rs at line 73
if let Ok(prefix) = prefix_.as_path().strip_prefix(repo.as_path()) {if let Ok(prefix) = prefix_.as_path().strip_prefix(repo) { - replacement in libpijul/src/working_copy/filesystem.rs at line 295
{let path = if let Ok(path) = full.as_path().strip_prefix(&repo_path.as_path()) {path} else {return Ok(());};use path_slash::PathExt;let path_str = path.to_slash_lossy();if !txn.read().is_tracked(&path_str)? {self.add_prefix_rec(&txn, repo_path, full, threads, salt)?;if let Ok(full) = CanonicalPathBuf::canonicalize(&full) {if let Ok(path) = full.as_path().strip_prefix(&repo_path.as_path()) {use path_slash::PathExt;let path_str = path.to_slash_lossy();if !txn.read().is_tracked(&path_str)? {self.add_prefix_rec(&txn, repo_path, full, threads, salt)?;}