Do not download changes if we already have them

[?]
Dec 7, 2020, 9:08 PM
X6YFD4WVMUYJCR5IYPJH6UKYVWSA7DKBRVJ6XQFXHOE2TRYUTAHAC

Dependencies

  • [2] BZSC7VMY address clippy lints
  • [3] 5QTMRUXN Fixing a race condition between progress bars
  • [4] UDHP4ZVB Fixing SSH asynchronicity issues
  • [5] 367UBQ6K Forwarding SSH stderr, and progress bar for push
  • [6] K6GWUOD5 Styling progress bars
  • [7] M5FK3ABT Complete dependencies when pushing and pulling
  • [8] 76PCXGML Pushing to, and pulling from the local repository
  • [9] Q45QHPO4 Feedback on network stuff
  • [10] HXEIH4UQ Pulling more than 100 changes at once
  • [11] I52XSRUH Massive cleanup, and simplification
  • [12] 5DVRL6MF Hard-unrecord
  • [13] BBKV6VMN Fixing push/pull messages, and do not reverse the changes to download/upload
  • [14] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [15] WKX5S4Z4 remove unneccesary explicit lifetimes

Change contents

  • replacement in pijul/src/remote/ssh.rs at line 410
    [4.4027][2.177:255]()
    sender.send(hashes[*current]).await.unwrap();
    [4.4027]
    [4.4113]
    if sender.send(hashes[*current]).await.is_err() {
    break;
    }
  • replacement in pijul/src/remote/mod.rs at line 446
    [4.68892][4.68892:68924]()
    to_download: Vec<Hash>,
    [4.68892]
    [4.68924]
    to_apply: &[Hash],
  • replacement in pijul/src/remote/mod.rs at line 452
    [4.69111][4.69111:69159]()
    let to_download_ = to_download.clone();
    [4.69111]
    [4.0]
    let mut to_download_ = Vec::new();
    for h in to_apply {
    libpijul::changestore::filesystem::push_filename(&mut change_path_, h);
    if std::fs::metadata(&change_path_).is_err() {
    to_download_.push(*h)
    }
    libpijul::changestore::filesystem::pop_filename(&mut change_path_);
    }
    let to_download = to_download_.clone();
  • replacement in pijul/src/remote/mod.rs at line 485
    [4.794][4.69865:69903](),[3.735][4.69865:69903](),[4.69865][4.69865:69903]()
    for h in to_download.iter() {
    [3.735]
    [4.69903]
    for h in to_apply {
  • replacement in pijul/src/remote/mod.rs at line 512
    [4.1177][3.736:810]()
    .template("✓ Applying changes {pos:>5}/{len}"),
    [4.1177]
    [4.1262]
    .template("✓ Applying changes {pos:>5}/{len}"),
  • edit in pijul/src/remote/mod.rs at line 518
    [4.70716]
    [4.294]
    debug!("waiting for spawned process");
  • edit in pijul/src/remote/mod.rs at line 521
    [4.321][4.70716:70763](),[3.847][4.70716:70763](),[4.70716][4.70716:70763]()
    debug!("waiting for spawned process");
  • replacement in pijul/src/remote/mod.rs at line 599
    [4.74014][4.74014:74109]()
    self.pull(repo, txn, channel, to_unrecord.clone(), false)
    .await?;
    [4.74014]
    [4.74109]
    self.pull(repo, txn, channel, &to_unrecord, false).await?;
  • replacement in pijul/src/remote/mod.rs at line 619
    [4.74687][4.74687:74748]()
    self.pull(repo, txn, channel, to_pull, true).await?;
    [4.74687]
    [4.74748]
    self.pull(repo, txn, channel, &to_pull, true).await?;
  • replacement in pijul/src/remote/mod.rs at line 702
    [4.78533][4.78533:78599]()
    self.pull(repo, txn, local_channel, pullable, true).await
    [4.78459]
    [4.78599]
    self.pull(repo, txn, local_channel, &pullable, true).await
  • replacement in pijul/src/commands/pushpull.rs at line 358
    [4.119922][4.119922:120101]()
    .pull(
    &mut repo,
    &mut txn,
    &mut channel,
    to_download.clone(),
    self.all,
    )
    [4.119922]
    [4.120101]
    .pull(&mut repo, &mut txn, &mut channel, &to_download, self.all)