Fixing a bug in patch download

pmeunier
Mar 1, 2023, 8:51 AM
IBPVOKM5MXTGB2P7LCD75MISAYUNDPEKQAUEVCXJJWLWCX2TJZBAC

Dependencies

  • [2] C3L2TLQW When downloading changes, check whether we have their dependencies and download them too
  • [3] ZWVYH7WP Pulling local tags
  • [4] XQHABMC2 Do not block when there is no patch to pull
  • [5] 5QTMRUXN Fixing a race condition between progress bars
  • [6] HXEIH4UQ Pulling more than 100 changes at once
  • [7] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [8] X6YFD4WV Do not download changes if we already have them
  • [9] BNPSVXIC Friendlier progress bars
  • [10] DO2Y5TY5 Tag synchronisation
  • [11] TKEVOH7H Fixing a bug when downloading changes, and making change download more efficient (more async)
  • [12] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [13] ZDK3GNDB Tag transactions (including a massive refactoring of errors)

Change contents

  • edit in pijul/src/remote/mod.rs at line 1162
    [3.69111][3.3025:3095]()
    let mut to_download = HashSet::with_capacity(to_apply.len());
  • edit in pijul/src/remote/mod.rs at line 1163
    [2.94]
    [3.231]
    let (send_ready, mut recv_ready) = tokio::sync::mpsc::channel(100);
  • edit in pijul/src/remote/mod.rs at line 1166
    [3.259]
    [3.0]
    debug!("to_apply {:?}", h);
  • edit in pijul/src/remote/mod.rs at line 1174
    [3.16468][3.298:408](),[3.408][2.95:125](),[2.125][3.408:448](),[3.408][3.408:448]()
    }
    if std::fs::metadata(&change_path_).is_err() {
    hash_send.send(*h)?;
    waiting += 1;
    to_download.insert(*h);
  • edit in pijul/src/remote/mod.rs at line 1175
    [3.454]
    [3.449]
    hash_send.send(*h)?;
    waiting += 1;
  • replacement in pijul/src/remote/mod.rs at line 1180
    [2.127][2.127:237]()
    let (u, mut to_apply) = self
    .download_changes_rec(repo, hash_send, recv, pro_a, waiting)
    [2.127]
    [2.237]
    let u = self
    .download_changes_rec(repo, hash_send, recv, send_ready, pro_a, waiting)
  • replacement in pijul/src/remote/mod.rs at line 1186
    [3.1454][2.259:311]()
    while let Some(h) = to_apply.recv().await {
    [3.1454]
    [3.3174]
    while let Some(h) = recv_ready.recv().await {
  • edit in pijul/src/remote/mod.rs at line 1248
    [2.800]
    [2.800]
    send_ready: tokio::sync::mpsc::Sender<CS>,
  • replacement in pijul/src/remote/mod.rs at line 1251
    [2.850][2.850:1100]()
    ) -> Result<
    (
    tokio::task::JoinHandle<Result<(), anyhow::Error>>,
    tokio::sync::mpsc::Receiver<CS>,
    ),
    anyhow::Error,
    > {
    let (send_ready, recv_ready) = tokio::sync::mpsc::channel(100);
    [2.850]
    [2.1100]
    ) -> Result<tokio::task::JoinHandle<Result<(), anyhow::Error>>, anyhow::Error> {
  • replacement in pijul/src/remote/mod.rs at line 1305
    [2.3274][2.3274:3302]()
    Ok((t, recv_ready))
    [2.3274]
    [2.3302]
    Ok(t)
  • replacement in pijul/src/remote/mod.rs at line 1345
    [3.72022][2.3447:3566]()
    let (u, mut recv_ready) = self
    .download_changes_rec(repo, send_hash, recv_signal, pro_n, waiting)
    [3.72022]
    [2.3566]
    let (send_ready, mut recv_ready) = tokio::sync::mpsc::channel(100);
    let u = self
    .download_changes_rec(repo, send_hash, recv_signal, send_ready, pro_n, waiting)