Clean up change file name handling

dblsaiko
Apr 1, 2024, 7:16 PM
UDGL7ER2R6SY2CBSPA4O4ULQ5PCUDWQBGYOWTN3MQGSS5L2EI2LQC

Dependencies

  • [2] UTEVDVGB Don't hardlink the same changefile twice
  • [3] ZLDTKXNA Extra debugging info in SSH
  • [4] TSQI6N2I Pop the filename in pijul::commands::tags after printing the first one
  • [5] 5SCFAC4I Fixing the unrecord of tags
  • [6] E6IKUIPD Command to delete a tag
  • [7] OGJFEWHU Fixing missing dependencies on partial clones
  • [8] C267PHOH Tags: dropping useless Hashes in favour of Merkles
  • [9] FE5ES6Q4 Stop pushing/pulling if the remote returns an error
  • [10] ISCWVXO6 Progress bar for push
  • [11] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [12] Q45QHPO4 Feedback on network stuff
  • [13] X6YFD4WV Do not download changes if we already have them
  • [14] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [15] BNPSVXIC Friendlier progress bars
  • [16] QL6K2ZM3 Tags
  • [17] QQS7LII4 Add value hints to arguments
  • [18] HXEIH4UQ Pulling more than 100 changes at once
  • [19] WTZXEWY7 Flushing the futures pipeline when downloading over HTTP(S)
  • [20] TYTQGSKZ Apply: proper error message when the change is not found
  • [21] GYXIF25T Proper parsing of URLs
  • [22] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [23] M2C6QW2A Avoid serialising twice in order to save the changes' signatures
  • [24] LGEJSLTY Fixing output (including its uses in reset and pull)
  • [25] I52XSRUH Massive cleanup, and simplification
  • [26] VO5OQW4W Removing anyhow in libpijul
  • [27] 3WO4H2MM Fixing async issues in downloads
  • [28] 5OGOE4VW Store the current channel in the pristine
  • [29] 76PCXGML Pushing to, and pulling from the local repository
  • [30] WLUID7NA Do not block when downloading more than 100 changes over SSH
  • [31] L3RCAPPK Add --repository to tag commands
  • [32] ZZXBHCN3 fixing the protocol
  • [33] E7UUQQCC Apply changes with prefixes in .pijul/changes
  • [34] AAXP2534 Tags: completing the subcommand
  • [35] X243Z3Y5 Recording only the required metadata (can even be changed later!)
  • [36] OIOMXESD Better error handling in HTTP
  • [37] H4AU6QRP New config for HTTP remotes
  • [38] RUBBHYZ7 Removing unnecessary async/await
  • [39] TKEVOH7H Fixing a bug when downloading changes, and making change download more efficient (more async)
  • [40] DO2Y5TY5 Tag synchronisation
  • [41] ABQDWHNG Migrate from `pijul::repository` to `pijul-repository`
  • [42] JUYSZJSH Migrate from `pijul::progress` to `pijul_interaction::progress`
  • [43] TYAKEAJL A better estimate of the maximum number of open patches we can keep (Unix-only at the moment)
  • [44] 4OJWMSOW Fully replace crate::Identity
  • [45] 367UBQ6K Forwarding SSH stderr, and progress bar for push
  • [46] ZDK3GNDB Tag transactions (including a massive refactoring of errors)
  • [47] I24UEJQL Various post-fire fixes
  • [48] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [49] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [50] ZWVYH7WP Pulling local tags
  • [51] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [52] UDHP4ZVB Fixing SSH asynchronicity issues
  • [53] ZBNKSYA6 Fixing a bus error when starting a transaction on a full disk
  • [54] DWSAYGVE Update codebase to use new identity management
  • [55] PIQCNEEB Upgrading to Clap 3.0.0-alpha.5
  • [56] 4XLHUME7 Fixing a interlocking when cloning from a particular patch
  • [57] OYN2YVPA Create `pijul_remote` crate
  • [58] 3KRGVQFU Do not update the mtime of unmodified files
  • [59] 7ZROQSSN Handling TAG uploads from the `pijul protocol` command
  • [60] A3RM526Y Integrating identity malleability
  • [61] DDJO7X2P Remove dependency on `num_cpus`
  • [62] GNMZNKB4 Cursors cleanup
  • [63] DX2FO4HZ Tag CLI cleanup
  • [64] 4HTHYIA3 Fixing HTTP download
  • [65] FBXYP7QM Forgot to add remote::http
  • [66] 2D7P2VKJ Change completions (where the whole progress bar story started)
  • [67] U6TQX5Z2 pager function respects cli option and user config files, PAGER env var
  • [68] IQ4FCHPZ HTTP connections: pooling + retry on error
  • [69] SZWBLWZ4 Reading ~/.ssh/config
  • [70] FZ7MXL3B Allow to use short tag hashes
  • [71] FDEVV5NG Tag check
  • [72] IBPVOKM5 Fixing a bug in patch download
  • [73] C3L2TLQW When downloading changes, check whether we have their dependencies and download them too
  • [*] RRCSHAYZ Formatting
  • [*] 5QTMRUXN Fixing a race condition between progress bars
  • [*] IVLLXQ5Z Improved push/pull reporting
  • [*] XQHABMC2 Do not block when there is no patch to pull
  • [*] L2VH4BYK Downloading changelists from channels without an id (Nest discussions)

Change contents

  • replacement in pijul-remote/src/ssh.rs at line 4
    [8.25667][8.1863:1887]()
    use std::path::PathBuf;
    [8.25667]
    [8.0]
    use std::path::{Path, PathBuf};
  • edit in pijul-remote/src/ssh.rs at line 12
    [8.156]
    [8.32]
    use libpijul::changestore::filesystem::fmt_filename;
  • replacement in pijul-remote/src/ssh.rs at line 343
    [8.492][8.0:29]()
    final_path: PathBuf,
    [8.492]
    [8.166]
    destdir: PathBuf,
  • replacement in pijul-remote/src/ssh.rs at line 524
    [8.2696][8.30:70]()
    ref mut final_path,
    [8.2696]
    [8.2696]
    ref destdir,
  • edit in pijul-remote/src/ssh.rs at line 528
    [8.2788]
    [8.89]
    let mut buf = PathBuf::new();
  • replacement in pijul-remote/src/ssh.rs at line 549
    [8.692][8.692:1149]()
    libpijul::changestore::filesystem::push_filename(final_path, h);
    debug!("moving {:?} to {:?}", path, final_path);
    std::fs::create_dir_all(&final_path.parent().unwrap())?;
    let r = std::fs::rename(&path, &final_path);
    libpijul::changestore::filesystem::pop_filename(final_path);
    [8.692]
    [8.1149]
    let p = fmt_filename(&mut buf, &destdir, &h);
    debug!("moving {:?} to {:?}", path, p);
    std::fs::create_dir_all(&p.parent().unwrap())?;
    let r = std::fs::rename(&path, &p);
  • replacement in pijul-remote/src/ssh.rs at line 556
    [8.1273][8.1273:1814]()
    libpijul::changestore::filesystem::push_tag_filename(
    final_path, &h,
    );
    debug!("moving {:?} to {:?}", path, final_path);
    std::fs::create_dir_all(&final_path.parent().unwrap())?;
    let r = std::fs::rename(&path, &final_path);
    libpijul::changestore::filesystem::pop_filename(final_path);
    [8.1273]
    [8.1814]
    let p = fmt_filename(&mut buf, &destdir, &h);
    debug!("moving {:?} to {:?}", path, p);
    std::fs::create_dir_all(&p.parent().unwrap())?;
    let r = std::fs::rename(&path, &p);
  • replacement in pijul-remote/src/ssh.rs at line 583
    [8.5342][3.0:135](),[3.135][3.135:179](),[3.179][3.179:259]()
    trace!(
    "writing to {:?} {:?} {:?}",
    path,
    final_path,
    hashes[*current]
    );
    [8.5342]
    [3.259]
    trace!("writing to {:?} {:?} {:?}", path, destdir, hashes[*current]);
  • replacement in pijul-remote/src/ssh.rs at line 934
    [8.22][8.44372:44400](),[8.82][8.44372:44400](),[8.44372][8.44372:44400]()
    mut local: PathBuf,
    [8.82]
    [8.44400]
    changes_dir: &Path,
  • edit in pijul-remote/src/ssh.rs at line 938
    [8.44497]
    [8.44497]
    let mut buf = PathBuf::new();
  • replacement in pijul-remote/src/ssh.rs at line 950
    [8.2148][8.2148:2306]()
    libpijul::changestore::filesystem::push_filename(&mut local, &c);
    let mut change_file = std::fs::File::open(&local)?;
    [8.2148]
    [8.2306]
    let p = fmt_filename(&mut buf, &changes_dir, &c);
    let mut change_file = std::fs::File::open(&p)?;
  • edit in pijul-remote/src/ssh.rs at line 963
    [8.2875][8.2875:2956]()
    libpijul::changestore::filesystem::pop_filename(&mut local);
  • replacement in pijul-remote/src/ssh.rs at line 965
    [8.3008][8.3008:3184]()
    libpijul::changestore::filesystem::push_tag_filename(&mut local, &c);
    let mut tag_file = libpijul::tag::OpenTagFile::open(&local, &c)?;
    [8.3008]
    [8.3184]
    let p = fmt_filename(&mut buf, &changes_dir, &c);
    let mut tag_file = libpijul::tag::OpenTagFile::open(&p, &c)?;
  • edit in pijul-remote/src/ssh.rs at line 976
    [8.3575][8.3575:3656]()
    libpijul::changestore::filesystem::pop_filename(&mut local);
  • replacement in pijul-remote/src/ssh.rs at line 988
    [8.60][8.8820:8855](),[8.3799][8.8820:8855](),[8.8820][8.8820:8855]()
    changes_dir: &mut PathBuf,
    [8.60]
    [8.45507]
    changes_dir: &Path,
  • replacement in pijul-remote/src/ssh.rs at line 1000
    [8.129][8.334:369](),[8.536][8.334:369](),[8.3918][8.334:369](),[8.334][8.334:369]()
    changes_dir: &mut PathBuf,
    [8.129]
    [8.369]
    changes_dir: &Path,
  • replacement in pijul-remote/src/ssh.rs at line 1004
    [8.8923][8.671:715]()
    let path = changes_dir.join("tmp");
    [8.8923]
    [8.715]
    let tmp_file = changes_dir.join("tmp");
  • replacement in pijul-remote/src/ssh.rs at line 1006
    [8.95][8.9044:9094](),[8.763][8.9044:9094](),[8.46580][8.9044:9094]()
    let file = std::fs::File::create(&path)?;
    [8.763]
    [8.9094]
    let file = std::fs::File::create(&tmp_file)?;
  • replacement in pijul-remote/src/ssh.rs at line 1010
    [8.9211][8.9211:9229](),[8.9229][8.764:809]()
    path,
    final_path: changes_dir.clone(),
    [8.9211]
    [8.9229]
    path: tmp_file,
    destdir: changes_dir.to_path_buf(),
  • replacement in pijul-remote/src/local.rs at line 2
    [8.63][8.11563:11587](),[8.291][8.11563:11587](),[8.4234][8.11563:11587](),[8.79745][8.11563:11587]()
    use std::path::PathBuf;
    [8.63]
    [8.918]
    use std::path::{Path, PathBuf};
  • edit in pijul-remote/src/local.rs at line 6
    [75.425]
    [8.9780]
    use libpijul::changestore::filesystem::fmt_filename;
  • replacement in pijul-remote/src/local.rs at line 212
    [8.82124][8.82124:82143]()
    &mut self,
    [8.82124]
    [8.3424]
    &self,
  • replacement in pijul-remote/src/local.rs at line 214
    [8.831][8.82143:82171](),[8.3459][8.82143:82171](),[8.82143][8.82143:82171]()
    mut local: PathBuf,
    [8.3459]
    [8.82171]
    changes_dir: &Path,
  • edit in pijul-remote/src/local.rs at line 218
    [8.82268]
    [8.1182]
    let mut buf = PathBuf::new();
    let mut buf2 = PathBuf::new();
  • replacement in pijul-remote/src/local.rs at line 230
    [8.82584][8.21554:21794]()
    match c {
    CS::Change(c) => {
    libpijul::changestore::filesystem::push_filename(&mut local, &c);
    libpijul::changestore::filesystem::push_filename(&mut self.changes_dir, &c);
    [8.82584]
    [8.21794]
    let src = fmt_filename(&mut buf, &changes_dir, c);
    let dest = fmt_filename(&mut buf2, &changes_dir, c);
    std::fs::create_dir_all(&dest.parent().unwrap())?;
    debug!("hard link {:?} {:?}", src, dest);
    if std::fs::metadata(&dest).is_err() {
    if std::fs::hard_link(&src, &dest).is_err() {
    std::fs::copy(&src, &dest)?;
  • edit in pijul-remote/src/local.rs at line 239
    [8.21812][8.21812:22055]()
    CS::State(c) => {
    libpijul::changestore::filesystem::push_tag_filename(&mut local, &c);
    libpijul::changestore::filesystem::push_tag_filename(&mut self.changes_dir, &c);
    }
  • edit in pijul-remote/src/local.rs at line 240
    [8.22069][8.82751:82894](),[8.82751][8.82751:82894](),[8.82894][2.0:220](),[2.220][8.3529:3543](),[8.3529][8.3529:3543]()
    std::fs::create_dir_all(&self.changes_dir.parent().unwrap())?;
    debug!("hard link {:?} {:?}", local, self.changes_dir);
    if std::fs::metadata(&self.changes_dir).is_err() {
    if std::fs::hard_link(&local, &self.changes_dir).is_err() {
    std::fs::copy(&local, &self.changes_dir)?;
    }
    }
  • edit in pijul-remote/src/local.rs at line 241
    [8.22108][8.22108:22265]()
    libpijul::changestore::filesystem::pop_filename(&mut local);
    libpijul::changestore::filesystem::pop_filename(&mut self.changes_dir);
  • replacement in pijul-remote/src/local.rs at line 260
    [8.11726][8.83493:83512](),[8.83493][8.83493:83512]()
    &mut self,
    [8.11726]
    [8.3546]
    &self,
  • replacement in pijul-remote/src/local.rs at line 264
    [8.1462][8.11839:11871](),[8.22379][8.11839:11871](),[8.11839][8.11839:11871]()
    mut path: &mut PathBuf,
    [8.1462]
    [8.83570]
    dest_dir: &Path,
  • edit in pijul-remote/src/local.rs at line 266
    [8.83607]
    [8.2842]
    let mut buf = PathBuf::new();
    let mut buf2 = PathBuf::new();
  • replacement in pijul-remote/src/local.rs at line 270
    [8.2892][8.601:840](),[8.840][8.22880:22898](),[8.22880][8.22880:22898](),[8.22898][8.841:1065](),[8.1065][8.23102:23120](),[8.23102][8.23102:23120](),[8.23120][8.1066:1080]()
    match c {
    CS::Change(c) => {
    libpijul::changestore::filesystem::push_filename(&mut self.changes_dir, &c);
    libpijul::changestore::filesystem::push_filename(&mut path, &c);
    }
    CS::State(c) => {
    libpijul::changestore::filesystem::push_tag_filename(&mut self.changes_dir, &c);
    libpijul::changestore::filesystem::push_tag_filename(&mut path, &c);
    }
    }
    [8.2892]
    [8.3582]
    let src = fmt_filename(&mut buf, &self.changes_dir, &c);
    let dest = fmt_filename(&mut buf2, &dest_dir, &c);
  • replacement in pijul-remote/src/local.rs at line 275
    [8.3616][8.1145:1245](),[8.1145][8.1145:1245](),[8.1245][7.3316:3404](),[8.1245][8.12157:12233](),[7.3404][8.12157:12233](),[8.23250][8.12157:12233](),[8.12157][8.12157:12233]()
    if std::fs::metadata(&path).is_ok() {
    debug!("metadata {:?} ok", path);
    libpijul::changestore::filesystem::pop_filename(&mut self.changes_dir);
    libpijul::changestore::filesystem::pop_filename(&mut path);
    [8.3616]
    [7.3405]
    if std::fs::metadata(&dest).is_ok() {
    debug!("metadata {:?} ok", dest);
  • replacement in pijul-remote/src/local.rs at line 280
    [8.1286][8.1286:1478]()
    std::fs::create_dir_all(&path.parent().unwrap())?;
    if std::fs::hard_link(&self.changes_dir, &path).is_err() {
    std::fs::copy(&self.changes_dir, &path)?;
    [8.1286]
    [8.12464]
    std::fs::create_dir_all(&dest.parent().unwrap())?;
    if std::fs::hard_link(&src, &dest).is_err() {
    std::fs::copy(&src, &dest)?;
  • replacement in pijul-remote/src/local.rs at line 284
    [8.1517][8.1517:1673]()
    libpijul::changestore::filesystem::pop_filename(&mut self.changes_dir);
    libpijul::changestore::filesystem::pop_filename(&mut path);
    [8.12478]
    [8.1510]
  • edit in pijul-remote/src/lib.rs at line 9
    [76.393]
    [77.0]
    use libpijul::changestore::filesystem;
    use libpijul::changestore::filesystem::fmt_filename;
  • edit in pijul-remote/src/lib.rs at line 51
    [8.52850]
    [8.52850]
    impl filesystem::CacheEntry for CS {
    fn hash(&self) -> String {
    match self {
    CS::Change(v) => v.hash(),
    CS::State(v) => v.hash(),
    }
    }
  • edit in pijul-remote/src/lib.rs at line 60
    [8.52851]
    [8.26]
    fn ext(&self) -> &str {
    match self {
    CS::Change(v) => v.ext(),
    CS::State(v) => v.ext(),
    }
    }
    }
  • replacement in pijul-remote/src/lib.rs at line 1131
    [8.2441][8.662:686]()
    local: PathBuf,
    [8.2441]
    [8.65227]
    changes_dir: &Path,
  • replacement in pijul-remote/src/lib.rs at line 1139
    [8.570][8.570:644]()
    l.upload_changes(upload_bar, local, to_channel, changes)?
    [8.570]
    [8.644]
    l.upload_changes(upload_bar, &changes_dir, to_channel, changes)?
  • replacement in pijul-remote/src/lib.rs at line 1142
    [8.496][8.659:732]()
    s.upload_changes(upload_bar, local, to_channel, changes)
    [8.496]
    [8.732]
    s.upload_changes(upload_bar, &changes_dir, to_channel, changes)
  • replacement in pijul-remote/src/lib.rs at line 1146
    [8.815][8.815:888]()
    h.upload_changes(upload_bar, local, to_channel, changes)
    [8.815]
    [8.888]
    h.upload_changes(upload_bar, &changes_dir, to_channel, changes)
  • replacement in pijul-remote/src/lib.rs at line 1152
    [8.925][8.925:952]()
    local,
    [8.925]
    [8.623]
    changes_dir.to_path_buf(),
  • replacement in pijul-remote/src/lib.rs at line 1168
    [8.256][8.66747:66775](),[8.10772][8.66747:66775](),[8.16081][8.66747:66775](),[8.66747][8.66747:66775]()
    path: &mut PathBuf,
    [8.256]
    [8.66775]
    path: &Path,
  • edit in pijul-remote/src/lib.rs at line 1245
    [8.2757][8.1348:1472](),[8.1348][8.1348:1472]()
    let mut change_path_ = repo.path.clone();
    change_path_.push(DOT_DIR);
    change_path_.push("changes");
  • edit in pijul-remote/src/lib.rs at line 1246
    [8.1694]
    [8.1472]
    let mut changes_dir = repo.changes_dir.clone();
  • replacement in pijul-remote/src/lib.rs at line 1253
    [8.1838][8.1838:1877]()
    &mut change_path_,
    [8.1838]
    [8.1877]
    &mut changes_dir,
  • edit in pijul-remote/src/lib.rs at line 1261
    [8.69054][8.69054:69111]()
    let mut change_path_ = repo.changes_dir.clone();
  • replacement in pijul-remote/src/lib.rs at line 1267
    [8.118][8.0:297](),[8.259][8.0:297](),[8.297][8.16450:16468](),[8.16450][8.16450:16468](),[8.448][8.440:454](),[8.1793][8.440:454](),[8.3173][8.440:454](),[8.16552][8.440:454](),[8.440][8.440:454]()
    match h {
    CS::Change(h) => {
    libpijul::changestore::filesystem::push_filename(&mut change_path_, h);
    }
    CS::State(h) => {
    libpijul::changestore::filesystem::push_tag_filename(&mut change_path_, h);
    }
    }
    [8.118]
    [8.41]
  • edit in pijul-remote/src/lib.rs at line 1271
    [8.178][8.449:529](),[8.454][8.449:529]()
    libpijul::changestore::filesystem::pop_filename(&mut change_path_);
  • replacement in pijul-remote/src/lib.rs at line 1355
    [8.1156][8.1156:1209]()
    let mut dep_path = repo.changes_dir.clone();
    [8.478]
    [8.1209]
    let changes_dir = repo.changes_dir.clone();
  • edit in pijul-remote/src/lib.rs at line 1358
    [8.1295]
    [78.0]
    let mut buf = PathBuf::new();
  • replacement in pijul-remote/src/lib.rs at line 1374
    [8.1957][8.1957:2056]()
    libpijul::changestore::filesystem::push_filename(&mut dep_path, &dep);
    [8.1957]
    [8.2056]
    let dep_path = fmt_filename(&mut buf, &changes_dir, &dep);
  • edit in pijul-remote/src/lib.rs at line 1376
    [8.2136][8.2136:2228]()
    libpijul::changestore::filesystem::pop_filename(&mut dep_path);
  • edit in pijul-remote/src/http.rs at line 2
    [8.11135]
    [79.2210]
    use libpijul::changestore::filesystem::fmt_filename;
  • replacement in pijul-remote/src/http.rs at line 8
    [8.1932][8.1932:1956]()
    use std::path::PathBuf;
    [8.1932]
    [8.23928]
    use std::path::{Path, PathBuf};
    use std::sync::Arc;
  • replacement in pijul-remote/src/http.rs at line 28
    [8.1215][8.101:124](),[8.2034][8.101:124](),[8.101][8.101:124]()
    mut path: PathBuf,
    [8.2034]
    [8.23953]
    base_dir: impl AsRef<Path>,
  • edit in pijul-remote/src/http.rs at line 31
    [8.23997]
    [8.23997]
    let base_dir = base_dir.as_ref();
    let mut buf = PathBuf::new();
    let path = fmt_filename(&mut buf, &base_dir, &c);
  • replacement in pijul-remote/src/http.rs at line 36
    [8.24028][8.24028:24180]()
    CS::Change(c) => {
    libpijul::changestore::filesystem::push_filename(&mut path, &c);
    ("change", c.to_base32())
    }
    [8.24028]
    [8.24180]
    CS::Change(c) => ("change", c.to_base32()),
  • edit in pijul-remote/src/http.rs at line 38
    [8.24206][8.24206:24287]()
    libpijul::changestore::filesystem::push_tag_filename(&mut path, &c);
  • replacement in pijul-remote/src/http.rs at line 152
    [8.1649][8.1436:1460](),[8.24836][8.1436:1460](),[8.1252][8.1436:1460]()
    path: &PathBuf,
    [8.1649]
    [8.1280]
    path: &Path,
  • edit in pijul-remote/src/http.rs at line 155
    [8.1338]
    [8.925]
    let path: Arc<Path> = Arc::from(path.to_path_buf().into_boxed_path());
  • replacement in pijul-remote/src/http.rs at line 229
    [8.1014][8.876:904](),[8.4026][8.876:904](),[8.876][8.876:904]()
    mut local: PathBuf,
    [8.4026]
    [8.904]
    changes_dir: &Path,
  • edit in pijul-remote/src/http.rs at line 233
    [8.1011]
    [8.1121]
    let mut buf = PathBuf::new();
  • edit in pijul-remote/src/http.rs at line 252
    [8.24886]
    [8.24886]
    let local = fmt_filename(&mut buf, &changes_dir, &c);
  • edit in pijul-remote/src/http.rs at line 256
    [8.24954][8.24954:25040]()
    libpijul::changestore::filesystem::push_filename(&mut local, &c);
  • edit in pijul-remote/src/http.rs at line 262
    [8.25277][8.25277:25367]()
    libpijul::changestore::filesystem::push_tag_filename(&mut local, &c);
  • edit in pijul-remote/src/http.rs at line 270
    [8.25698][8.25698:25771]()
    libpijul::changestore::filesystem::pop_filename(&mut local);
  • replacement in pijul/src/commands/tag.rs at line 8
    [8.255][8.2342:2427]()
    use libpijul::{ArcTxn, Base32, ChannelMutTxnT, ChannelTxnT, MutTxnT, TxnT, TxnTExt};
    [8.255]
    [8.0]
    use libpijul::changestore::filesystem::fmt_filename;
    use libpijul::{ArcTxn, Base32, ChannelMutTxnT, ChannelTxnT, Merkle, MutTxnT, TxnT, TxnTExt};
  • edit in pijul/src/commands/tag.rs at line 120
    [8.2655][8.0:61](),[8.61][8.2764:2817](),[8.2764][8.2764:2817]()
    let mut tag_path = repo.changes_dir.clone();
    std::fs::create_dir_all(&tag_path)?;
  • replacement in pijul/src/commands/tag.rs at line 121
    [8.2818][8.2818:2872](),[8.2872][8.62:101]()
    let mut temp_path = tag_path.clone();
    temp_path.push("tmp");
    [8.2818]
    [8.2911]
    std::fs::create_dir_all(&repo.changes_dir)?;
    let temp_path = repo.changes_dir.join("tmp");
  • replacement in pijul/src/commands/tag.rs at line 129
    [8.212][8.212:301]()
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &h);
    [8.212]
    [8.3230]
    let mut buf = PathBuf::new();
    let tag_path = fmt_filename(&mut buf, &repo.changes_dir, &h);
  • replacement in pijul/src/commands/tag.rs at line 145
    [8.689][8.150:211](),[8.211][8.380:562](),[8.263][8.3678:3700](),[8.312][8.3678:3700](),[8.562][8.3678:3700](),[8.3678][8.3678:3700](),[8.433][8.3700:3725](),[8.3700][8.3700:3725](),[8.3725][8.0:59]()
    let mut tag_path = repo.changes_dir.clone();
    let h = if let Some(h) = libpijul::Merkle::from_base32(tag.as_bytes()) {
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &h);
    h
    } else {
    super::find_hash(&mut tag_path, &tag)?
    [8.689]
    [8.3776]
    let h = match Merkle::from_base32(tag.as_bytes()) {
    None => super::find_hash(&repo.changes_dir, &tag)?,
    Some(v) => v,
  • edit in pijul/src/commands/tag.rs at line 150
    [8.3795]
    [8.486]
    let mut buf = PathBuf::new();
    let tag_path = fmt_filename(&mut buf, &repo.changes_dir, &h);
  • replacement in pijul/src/commands/tag.rs at line 171
    [8.5721][8.369:430](),[8.430][8.638:820](),[8.482][8.6006:6112](),[8.820][8.6006:6112](),[8.6006][8.6006:6112]()
    let mut tag_path = repo.changes_dir.clone();
    let h = if let Some(h) = libpijul::Merkle::from_base32(tag.as_bytes()) {
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &h);
    h
    } else {
    super::find_hash(&mut tag_path, &tag)?
    [8.5721]
    [8.6112]
    let h = match Merkle::from_base32(tag.as_bytes()) {
    None => super::find_hash(&repo.changes_dir, &tag)?,
    Some(v) => v,
  • edit in pijul/src/commands/tag.rs at line 177
    [8.6132]
    [8.483]
    let mut buf = PathBuf::new();
    let tag_path = fmt_filename(&mut buf, &repo.changes_dir, &h);
  • replacement in pijul/src/commands/tag.rs at line 210
    [6.882][6.882:1231]()
    let mut tag_path = repo.changes_dir.clone();
    let h = if let Some(h) = libpijul::Merkle::from_base32(tag.as_bytes()) {
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &h);
    h
    } else {
    super::find_hash(&mut tag_path, &tag)?
    [6.882]
    [6.1231]
    let h = match Merkle::from_base32(tag.as_bytes()) {
    None => super::find_hash(&repo.changes_dir, &tag)?,
    Some(v) => v,
  • replacement in pijul/src/commands/tag.rs at line 250
    [8.708][8.559:620]()
    let mut tag_path = repo.changes_dir.clone();
    [8.708]
    [8.0]
    let mut buf = PathBuf::new();
  • replacement in pijul/src/commands/tag.rs at line 255
    [8.26959][8.936:1029](),[8.936][8.936:1029]()
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &m);
    [8.26959]
    [5.0]
    let tag_path = fmt_filename(&mut buf, &repo.changes_dir, &m);
  • edit in pijul/src/commands/tag.rs at line 263
    [8.1582][4.0:84]()
    libpijul::changestore::filesystem::pop_filename(&mut tag_path);
  • replacement in pijul/src/commands/pushpull.rs at line 317
    [8.8905][8.8905:8947]()
    repo.changes_dir.clone(),
    [8.8905]
    [8.8947]
    &repo.changes_dir,
  • edit in pijul/src/commands/protocol.rs at line 11
    [8.1961]
    [8.15132]
    use libpijul::changestore::filesystem::fmt_filename;
  • replacement in pijul/src/commands/protocol.rs at line 56
    [8.1528][8.15774:15837](),[8.6860][8.15774:15837]()
    let mut repo = Repository::find_root(self.repo_path)?;
    [8.1528]
    [7.3472]
    let repo = Repository::find_root(self.repo_path)?;
  • edit in pijul/src/commands/protocol.rs at line 62
    [8.125102]
    [8.125102]
    let mut path_buf = PathBuf::new();
  • replacement in pijul/src/commands/protocol.rs at line 179
    [8.137][8.34286:34448]()
    let mut tag_path = repo.changes_dir.clone();
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &state);
    [8.137]
    [8.34448]
    let tag_path = fmt_filename(&mut path_buf, &repo.changes_dir, &state);
  • replacement in pijul/src/commands/protocol.rs at line 192
    [8.341][8.34919:35085]()
    let mut tag_path = repo.changes_dir.clone();
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &m);
    [8.341]
    [8.35085]
    let tag_path = fmt_filename(&mut path_buf, &repo.changes_dir, &state);
  • replacement in pijul/src/commands/protocol.rs at line 236
    [8.128478][8.128478:128769]()
    libpijul::changestore::filesystem::push_filename(&mut repo.changes_dir, &h);
    debug!("repo = {:?}", repo.changes_dir);
    let mut f = std::fs::File::open(&repo.changes_dir)?;
    let size = std::fs::metadata(&repo.changes_dir)?.len();
    [8.128478]
    [8.128769]
    let path = fmt_filename(&mut path_buf, &repo.changes_dir, &h);
    debug!("repo = {:?}", path);
    let mut f = std::fs::File::open(&path)?;
    let size = std::fs::metadata(&path)?.len();
  • edit in pijul/src/commands/protocol.rs at line 261
    [8.129500][8.129500:129588]()
    libpijul::changestore::filesystem::pop_filename(&mut repo.changes_dir);
  • replacement in pijul/src/commands/protocol.rs at line 268
    [8.129958][8.129958:130096]()
    let mut path = repo.changes_dir.clone();
    libpijul::changestore::filesystem::push_filename(&mut path, &h);
    [8.129958]
    [8.0]
    let path = fmt_filename(&mut path_buf, &repo.changes_dir, &h);
  • edit in pijul/src/commands/mod.rs at line 2
    [8.19773]
    [8.19773]
    use std::path::Path;
  • replacement in pijul/src/commands/mod.rs at line 286
    [8.69][8.1179:1297]()
    fn find_hash<B: libpijul::Base32>(
    path: &mut std::path::PathBuf,
    hash: &str,
    ) -> Result<B, anyhow::Error> {
    [8.20228]
    [8.194]
    fn find_hash<B: libpijul::Base32>(base_dir: &Path, hash: &str) -> Result<B, anyhow::Error> {
  • replacement in pijul/src/commands/mod.rs at line 291
    [8.321][8.321:339]()
    path.push(a);
    [8.321]
    [8.339]
    let mut path = base_dir.join(a);
  • replacement in pijul/src/commands/apply.rs at line 86
    [8.305][8.1149:1286]()
    let mut changes = repo.changes_dir.clone();
    super::find_hash(&mut changes, &ch)?
    [8.305]
    [8.707]
    super::find_hash(&repo.changes_dir, &ch)?
  • edit in libpijul/src/changestore/filesystem.rs at line 35
    [8.46709]
    [8.824519]
    }
    pub trait CacheEntry {
    fn hash(&self) -> String;
    fn ext(&self) -> &str;
  • replacement in libpijul/src/changestore/filesystem.rs at line 42
    [8.824522][8.824522:824742]()
    pub fn push_filename(changes_dir: &mut PathBuf, hash: &Hash) {
    let h32 = hash.to_base32();
    let (a, b) = h32.split_at(2);
    changes_dir.push(a);
    changes_dir.push(b);
    changes_dir.set_extension("change");
    [8.824522]
    [8.6585]
    impl<T> CacheEntry for &T
    where
    T: CacheEntry,
    {
    fn hash(&self) -> String {
    (*self).hash()
    }
    fn ext(&self) -> &str {
    (*self).ext()
    }
  • replacement in libpijul/src/changestore/filesystem.rs at line 55
    [8.6588][8.6588:6811]()
    pub fn push_tag_filename(changes_dir: &mut PathBuf, hash: &Merkle) {
    let h32 = hash.to_base32();
    let (a, b) = h32.split_at(2);
    changes_dir.push(a);
    changes_dir.push(b);
    changes_dir.set_extension("tag");
    [8.6588]
    [8.824742]
    impl CacheEntry for Hash {
    fn hash(&self) -> String {
    self.to_base32()
    }
    fn ext(&self) -> &str {
    "change"
    }
  • replacement in libpijul/src/changestore/filesystem.rs at line 65
    [8.824745][8.824745:824840]()
    pub fn pop_filename(changes_dir: &mut PathBuf) {
    changes_dir.pop();
    changes_dir.pop();
    [8.824745]
    [8.824840]
    impl CacheEntry for Merkle {
    fn hash(&self) -> String {
    self.to_base32()
    }
    fn ext(&self) -> &str {
    "tag"
    }
  • edit in libpijul/src/changestore/filesystem.rs at line 75
    [8.824843]
    [8.824843]
    pub fn fmt_filename<'a, T>(buf: &'a mut PathBuf, changes_dir: &Path, entry: &T) -> &'a Path
    where
    T: CacheEntry,
    {
    let hash = entry.hash();
    let (shard, rem) = hash.split_at(2);
    buf.clear();
    buf.push(changes_dir);
    buf.push(shard);
    buf.push(rem);
    buf.set_extension(entry.ext());
    buf
    }
  • replacement in libpijul/src/changestore/filesystem.rs at line 91
    [8.824861][8.824861:824914](),[8.824914][8.87778:87827](),[8.87827][8.824965:825005](),[8.824965][8.824965:825005]()
    pub fn filename(&self, hash: &Hash) -> PathBuf {
    let mut path = self.changes_dir.clone();
    push_filename(&mut path, hash);
    [8.824861]
    [8.46710]
    pub fn filename<T>(&self, entry: &T) -> PathBuf
    where
    T: CacheEntry,
    {
    let mut path = PathBuf::new();
    self.fmt_filename(&mut path, entry);
  • replacement in libpijul/src/changestore/filesystem.rs at line 100
    [8.46730][8.46730:46882](),[8.46882][8.825005:825018](),[8.825005][8.825005:825018]()
    pub fn tag_filename(&self, hash: &Merkle) -> PathBuf {
    let mut path = self.changes_dir.clone();
    push_tag_filename(&mut path, hash);
    path
    [8.46730]
    [8.825018]
    pub fn fmt_filename<'a, T>(&self, buf: &'a mut PathBuf, entry: &T) -> &'a Path
    where
    T: CacheEntry,
    {
    fmt_filename(buf, &self.changes_dir, entry)
  • replacement in libpijul/src/changestore/filesystem.rs at line 203
    [8.46963][8.46963:47004]()
    let path = self.tag_filename(h);
    [8.46963]
    [8.47004]
    let path = self.filename(h);