Canonicalize all paths

[?]
Dec 15, 2020, 10:30 AM
ZHABNS3S6FSINO74FOI5KHYXYDTBPO4FQTTYTUS7NNKEVVNLYC4AC

Dependencies

  • [2] GBLM3JLR Fix options of git subcommand
  • [3] OJZWJUF2 MUCH faster `pijul add -r`
  • [4] YDKNUL6B Add `diff --short` that lists changes without showing them
  • [5] KWAMD2KR A few fixes in the documentation comments
  • [6] ZXTHL45O address clippy lints
  • [7] WI5BS6BS New published versions
  • [8] T7IIQFM4
  • [9] I52XSRUH Massive cleanup, and simplification
  • [10] R3H7D42U Debugging `pijul git`: proper error reporting
  • [11] VO5OQW4W Removing anyhow in libpijul
  • [12] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [13] 4OCC6D42 Recursive add
  • [14] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [15] PJ7T2VFL Do not hang on locked repositories
  • [16] MF3WAHBI commands/record: amend current change if unspecified
  • [17] WKX5S4Z4 remove unneccesary explicit lifetimes
  • [18] CVAT6LN3 Fixing git import, and adding more useful feedback (with `RUST_LOG="pijul=info"`)
  • [*] 2K7JLB4Z No pager on Windows
  • [*] OUWD436A Version bump

Change contents

  • replacement in pijul/src/commands/record.rs at line 3
    [4.1453][4.1453:1485]()
    use std::path::{Path, PathBuf};
    [4.1453]
    [4.1485]
    use std::path::PathBuf;
  • edit in pijul/src/commands/record.rs at line 5
    [4.1486]
    [4.101804]
    use canonical_path::CanonicalPathBuf;
  • replacement in pijul/src/commands/record.rs at line 92
    [4.104199][4.104199:104223]()
    &repo.path,
    [4.104199]
    [4.104223]
    CanonicalPathBuf::canonicalize(&repo.path)?,
  • replacement in pijul/src/commands/record.rs at line 161
    [4.106658][4.106658:106684]()
    repo_path: &Path,
    [4.106658]
    [4.106684]
    repo_path: CanonicalPathBuf,
  • edit in pijul/src/commands/git.rs at line 7
    [4.2237]
    [2.0]
    use canonical_path::CanonicalPathBuf;
  • replacement in pijul/src/commands/git.rs at line 631
    [4.158586][4.158586:158611]()
    &repo.repo.path,
    [4.158586]
    [4.158611]
    &CanonicalPathBuf::canonicalize(&repo.repo.path)?,
  • replacement in pijul/src/commands/git.rs at line 684
    [4.160587][4.160587:160609]()
    repo_path: &Path,
    [4.160587]
    [4.160609]
    repo_path: &CanonicalPathBuf,
  • replacement in pijul/src/commands/git.rs at line 687
    [4.160679][4.525:646]()
    ) -> Result<
    (usize, Option<libpijul::Hash>, Option<libpijul::Merkle>),
    libpijul::LocalApplyError<T::Error>,
    > {
    [4.160679]
    [4.160829]
    ) -> Result<(usize, Option<libpijul::Hash>, libpijul::Merkle), libpijul::LocalApplyError<T::Error>>
    {
  • replacement in pijul/src/commands/git.rs at line 692
    [4.219][3.71:191]()
    let result =
    working_copy.record_prefix(txn, channel, changes, &mut state, repo_path, p, num_cpus);
    [4.219]
    [4.647]
    let result = working_copy.record_prefix(
    txn,
    channel,
    changes,
    &mut state,
    repo_path.clone(),
    p,
    num_cpus,
    );
  • edit in pijul/src/commands/file_operations.rs at line 4
    [4.2405]
    [4.2405]
    use canonical_path::CanonicalPathBuf;
  • edit in pijul/src/commands/file_operations.rs at line 103
    [3.231]
    [4.171551]
    let repo_path = CanonicalPathBuf::canonicalize(&repo.path)?;
  • replacement in pijul/src/commands/file_operations.rs at line 112
    [4.340][4.340:459](),[4.459][3.232:320]()
    if let Ok((full, prefix)) = get_prefix(Some(&repo.path), path) {
    repo.working_copy
    .add_prefix_rec(&mut txn, &repo.path, &full, &prefix, threads)?
    [4.340]
    [4.538]
    if let Ok((full, prefix)) = get_prefix(Some(repo_path.as_ref()), path) {
    repo.working_copy.add_prefix_rec(
    &mut txn,
    repo_path.clone(),
    full.clone(),
    &prefix,
    threads,
    )?
  • edit in pijul/src/commands/diff.rs at line 5
    [4.2554]
    [4.2554]
    use canonical_path::CanonicalPathBuf;
  • replacement in pijul/src/commands/diff.rs at line 59
    [4.174952][4.174952:174980]()
    &repo.path,
    [4.174952]
    [4.174980]
    CanonicalPathBuf::canonicalize(&repo.path)?,
  • edit in pijul/Cargo.toml at line 80
    [3.373]
    [20.309]
    canonical-path = "2.0"
  • edit in libpijul/src/working_copy/filesystem.rs at line 3
    [4.209006]
    [4.209006]
    use canonical_path::{CanonicalPath, CanonicalPathBuf};
  • edit in libpijul/src/working_copy/filesystem.rs at line 5
    [4.209031]
    [4.209031]
    use std::borrow::Cow;
  • replacement in libpijul/src/working_copy/filesystem.rs at line 32
    [4.209129][4.209129:209159]()
    repo_path: Option<&Path>,
    [4.209129]
    [4.209159]
    repo_path: Option<&CanonicalPath>,
  • replacement in libpijul/src/working_copy/filesystem.rs at line 34
    [4.209178][4.3200:3249]()
    ) -> Result<(PathBuf, String), std::io::Error> {
    [4.209178]
    [4.209226]
    ) -> Result<(canonical_path::CanonicalPathBuf, String), std::io::Error> {
  • replacement in libpijul/src/working_copy/filesystem.rs at line 37
    [4.209304][4.209304:209341]()
    std::fs::canonicalize(repo)?
    [4.209304]
    [4.209341]
    Cow::Borrowed(repo)
  • replacement in libpijul/src/working_copy/filesystem.rs at line 39
    [4.209354][4.209354:209387]()
    std::env::current_dir()?
    [4.209354]
    [4.209387]
    Cow::Owned(canonical_path::CanonicalPathBuf::canonicalize(
    std::env::current_dir()?,
    )?)
  • replacement in libpijul/src/working_copy/filesystem.rs at line 44
    [4.209431][4.209431:209577]()
    let prefix_ = if let Ok(prefix_) = std::fs::canonicalize(repo.join(&prefix)) {
    prefix_
    } else {
    repo.join(&prefix)
    };
    [4.209431]
    [4.209577]
    let prefix_ = repo.join(&prefix)?;
  • replacement in libpijul/src/working_copy/filesystem.rs at line 46
    [4.209617][4.209617:209670]()
    if let Ok(prefix) = prefix_.strip_prefix(repo) {
    [4.209617]
    [4.209670]
    if let Ok(prefix) = prefix_.as_path().strip_prefix(repo.as_path()) {
  • replacement in libpijul/src/working_copy/filesystem.rs at line 93
    [4.210384][4.210384:210410]()
    repo_path: &Path,
    [4.210384]
    [4.210410]
    repo_path: CanonicalPathBuf,
  • replacement in libpijul/src/working_copy/filesystem.rs at line 103
    [3.525][3.525:552]()
    repo_path,
    [3.525]
    [3.552]
    repo_path.clone(),
  • replacement in libpijul/src/working_copy/filesystem.rs at line 114
    [3.752][3.752:779]()
    repo_path,
    [3.752]
    [3.779]
    repo_path.clone(),
  • replacement in libpijul/src/working_copy/filesystem.rs at line 125
    [4.1723][4.1723:1770]()
    repo_path: &Path,
    full: &Path,
    [4.1723]
    [4.1770]
    repo_path: CanonicalPathBuf,
    full: CanonicalPathBuf,
  • edit in libpijul/src/working_copy/filesystem.rs at line 131
    [4.1875][4.1875:1935]()
    let repo_path_ = std::fs::canonicalize(repo_path)?;
  • edit in libpijul/src/working_copy/filesystem.rs at line 134
    [4.2054][4.2054:2110]()
    debug!("{:?}", full.strip_prefix(&repo_path_));
  • replacement in libpijul/src/working_copy/filesystem.rs at line 135
    [3.945][3.945:984]()
    let full = full.to_path_buf();
    [3.945]
    [3.984]
    debug!("{:?}", full.as_path().strip_prefix(repo_path.as_path()));
  • replacement in libpijul/src/working_copy/filesystem.rs at line 160
    [3.2125][3.2125:2573]()
    debug!("entry path = {:?} {:?}", entry.path(), repo_path_);
    if let Ok(path) = entry.path().strip_prefix(&repo_path_) {
    let is_dir = entry.file_type().unwrap().is_dir();
    sender.send((path.to_path_buf(), is_dir)).unwrap();
    } else {
    debug!("entry = {:?}", entry.path());
    [3.2125]
    [4.2677]
    debug!("entry path = {:?} {:?}", entry.path(), repo_path);
    if let Ok(entry_path) = CanonicalPathBuf::canonicalize(entry.path()) {
    if let Ok(path) = entry_path.as_path().strip_prefix(&repo_path) {
    let is_dir = entry.file_type().unwrap().is_dir();
    sender.send((path.to_path_buf(), is_dir)).unwrap();
    } else {
    debug!("entry = {:?}", entry.path());
    }
  • replacement in libpijul/src/working_copy/filesystem.rs at line 172
    [3.2680][3.2680:2754]()
    } else if let Ok(path) = full.strip_prefix(&repo_path_) {
    [3.2680]
    [3.2754]
    } else if let Ok(path) = full.as_path().strip_prefix(&repo_path.as_path()) {
  • replacement in libpijul/src/working_copy/filesystem.rs at line 200
    [4.211233][4.211233:211259]()
    repo_path: &Path,
    [4.211233]
    [4.211259]
    repo_path: CanonicalPathBuf,
  • replacement in libpijul/src/working_copy/filesystem.rs at line 204
    [4.3917][4.211425:211500](),[4.211425][4.211425:211500](),[4.211500][3.3131:3206]()
    if let Ok((full, prefix)) = get_prefix(Some(&repo_path), prefix) {
    self.add_prefix_rec(txn, repo_path, &full, &prefix, threads)?;
    [4.3917]
    [4.213590]
    if let Ok((full, prefix)) = get_prefix(Some(repo_path.as_ref()), prefix) {
    self.add_prefix_rec(txn, repo_path, full, &prefix, threads)?;
  • replacement in libpijul/src/record.rs at line 408
    [4.503028][4.503028:503104]()
    debug!("new actions: {:?}", &self.rec.actions.len() - len);
    [4.503028]
    [4.503104]
    debug!(
    "new actions: {:?}, total {:?}",
    &self.rec.actions.len() - len,
    self.rec.actions.len()
    );
  • replacement in libpijul/Cargo.toml at line 86
    [4.1022736][4.1022736:1022780]()
    ondisk-repos = [ "mmap", "zstd", "ignore" ]
    [4.1022736]
    [4.1022780]
    ondisk-repos = [ "mmap", "zstd", "ignore", "canonical-path" ]
  • edit in libpijul/Cargo.toml at line 120
    [4.1023703]
    [4.1023703]
    canonical-path = { version = "2.0", optional = true }
  • edit in Cargo.lock at line 156
    [4.1035263]
    [4.1035263]
    [[package]]
    name = "canonical-path"
    version = "2.0.2"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f"
  • edit in Cargo.lock at line 979
    [21.807]
    [21.807]
    "canonical-path",
  • edit in Cargo.lock at line 1347
    [4.1064139]
    [4.1064139]
    "canonical-path",