Downloading changelists from channels without an id (Nest discussions)

pmeunier
Jul 4, 2021, 3:30 PM
L2VH4BYK3IULLGBHXMZJWKRKDQY43QEMQRTXFJCNRDE7PODLXWTAC

Dependencies

  • [2] A3RM526Y Integrating identity malleability
  • [3] 2D7P2VKJ Change completions (where the whole progress bar story started)
  • [4] IQ4FCHPZ HTTP connections: pooling + retry on error
  • [5] TPEH2XNB 1.0.0-alpha.28, with Tokio 1.0
  • [6] Q45QHPO4 Feedback on network stuff
  • [7] HXEIH4UQ Pulling more than 100 changes at once
  • [8] UDHP4ZVB Fixing SSH asynchronicity issues
  • [9] 2GQCLJZG Displaying errors returned by the server in the protocol
  • [10] X6YFD4WV Do not download changes if we already have them
  • [11] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [12] 367UBQ6K Forwarding SSH stderr, and progress bar for push
  • [13] FBXYP7QM Forgot to add remote::http
  • [14] GYXIF25T Proper parsing of URLs
  • [15] 44BN7FWS Do not output files introduced by patches that were not applied during a push
  • [16] YN63NUZO Sanakirja 1.0
  • [17] TKEVOH7H Fixing a bug when downloading changes, and making change download more efficient (more async)
  • [18] JRENVH5D Reqwest 0.11
  • [19] WKX5S4Z4 remove unneccesary explicit lifetimes
  • [20] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [21] BNPSVXIC Friendlier progress bars
  • [22] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [23] 76PCXGML Pushing to, and pulling from the local repository
  • [24] I52XSRUH Massive cleanup, and simplification
  • [25] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)

Change contents

  • replacement in pijul/src/remote/ssh.rs at line 12
    [3.66][3.6007:6054]()
    use libpijul::{Base32, Hash, Merkle, MutTxnT};
    [3.66]
    [3.0]
    use libpijul::{Base32, Hash, Merkle};
  • replacement in pijul/src/remote/ssh.rs at line 18
    [3.25789][3.295:331]()
    use super::{parse_line, RemoteRef};
    [3.25789]
    [3.384]
    use super::parse_line;
  • replacement in pijul/src/remote/ssh.rs at line 463
    [2.1195][2.1195:1250]()
    debug!("state: State {:?}", data);
    [2.1195]
    [2.1250]
    debug!("state: Id {:?}", data);
  • replacement in pijul/src/remote/ssh.rs at line 465
    [2.1308][2.1308:1373]()
    let line = if data.last() == Some(&10) {
    [2.1308]
    [2.1373]
    let line = if data.len() >= 16 && data.last() == Some(&10) {
  • replacement in pijul/src/remote/ssh.rs at line 842
    [3.42015][3.42015:42065]()
    pub async fn download_changelist<T: MutTxnT>(
    [3.42015]
    [3.42065]
    pub async fn download_changelist<
    A,
    F: FnMut(&mut A, u64, Hash, libpijul::Merkle) -> Result<(), anyhow::Error>,
    >(
  • replacement in pijul/src/remote/ssh.rs at line 847
    [3.42084][3.42084:42140]()
    txn: &mut T,
    remote: &mut RemoteRef<T>,
    [3.42084]
    [3.42140]
    mut f: F,
    a: &mut A,
  • replacement in pijul/src/remote/ssh.rs at line 870
    [3.528][3.528:659]()
    super::ListLine::Change { n, h, m } => {
    txn.put_remote(remote, n, (h, m))?;
    }
    [3.528]
    [3.659]
    super::ListLine::Change { n, h, m } => f(a, n, h, m)?,
  • edit in pijul/src/remote/mod.rs at line 322
    [3.1161]
    [3.63752]
    let f = |a: &mut (&mut T, &mut RemoteRef<T>), n, h, m| {
    let (ref mut txn, ref mut remote) = *a;
    txn.put_remote(remote, n, (h, m))?;
    Ok(())
    };
  • replacement in pijul/src/remote/mod.rs at line 328
    [3.63774][3.63774:63964](),[3.63964][3.1162:1256]()
    RemoteRepo::Local(ref mut l) => l.download_changelist(txn, remote, from, paths),
    RemoteRepo::Ssh(ref mut s) => s.download_changelist(txn, remote, from, paths).await,
    RemoteRepo::Http(ref h) => h.download_changelist(txn, remote, from, paths).await,
    [3.63774]
    [3.1256]
    RemoteRepo::Local(ref mut l) => {
    l.download_changelist(f, &mut (txn, remote), from, paths)
    }
    RemoteRepo::Ssh(ref mut s) => {
    s.download_changelist(f, &mut (txn, remote), from, paths)
    .await
    }
    RemoteRepo::Http(ref h) => {
    h.download_changelist(f, &mut (txn, remote), from, paths)
    .await
    }
  • replacement in pijul/src/remote/mod.rs at line 388
    [2.7189][2.7189:7221]()
    async fn update_identities(
    [2.7189]
    [2.7221]
    pub async fn update_identities<T: MutTxnTExt + TxnTExt + GraphIter>(
  • replacement in pijul/src/remote/mod.rs at line 390
    [2.7240][2.7240:7327]()
    rev: Option<u64>,
    path: PathBuf,
    ) -> Result<u64, anyhow::Error> {
    [2.7240]
    [2.7327]
    repo: &mut Repository,
    remote: &RemoteRef<T>,
    ) -> Result<(), anyhow::Error> {
    let mut id_path = repo.path.clone();
    id_path.push(DOT_DIR);
    id_path.push("identities");
    let rev = None;
  • replacement in pijul/src/remote/mod.rs at line 398
    [2.7357][2.7357:7603]()
    RemoteRepo::Local(ref mut l) => l.update_identities(rev, path).await?,
    RemoteRepo::Ssh(ref mut s) => s.update_identities(rev, path).await?,
    RemoteRepo::Http(ref mut h) => h.update_identities(rev, path).await?,
    [2.7357]
    [2.7603]
    RemoteRepo::Local(ref mut l) => l.update_identities(rev, id_path).await?,
    RemoteRepo::Ssh(ref mut s) => s.update_identities(rev, id_path).await?,
    RemoteRepo::Http(ref mut h) => h.update_identities(rev, id_path).await?,
  • replacement in pijul/src/remote/mod.rs at line 404
    [2.7708][2.7708:7722]()
    Ok(r)
    [2.7708]
    [3.68729]
    remote.set_id_revision(r)?;
    Ok(())
  • edit in pijul/src/remote/mod.rs at line 410
    [3.118][2.7723:7754]()
    remote: &RemoteRef<T>,
  • edit in pijul/src/remote/mod.rs at line 518
    [2.7799][2.7799:7990]()
    let mut id_path = repo.path.clone();
    id_path.push(DOT_DIR);
    id_path.push("identities");
    remote.set_id_revision(self.update_identities(None, id_path).await?)?;
  • replacement in pijul/src/remote/mod.rs at line 614
    [3.74687][2.8127:8207]()
    self.pull(&remote, repo, txn, channel, &to_pull, &HashSet::new(), true)
    [3.74687]
    [3.2029]
    self.pull(repo, txn, channel, &to_pull, &HashSet::new(), true)
  • edit in pijul/src/remote/mod.rs at line 616
    [3.2050]
    [3.2050]
    self.update_identities(repo, &remote).await?;
  • replacement in pijul/src/remote/mod.rs at line 722
    [3.78459][2.8410:8609]()
    self.pull(
    &remote_changes,
    repo,
    txn,
    local_channel,
    &pullable,
    &inodes,
    true,
    )
    .await?;
    [3.78459]
    [3.2742]
    self.pull(repo, txn, local_channel, &pullable, &inodes, true)
    .await?;
    self.update_identities(repo, &remote_changes).await?;
  • edit in pijul/src/remote/local.rs at line 9
    [3.552][3.552:575]()
    use super::RemoteRef;
  • replacement in pijul/src/remote/local.rs at line 50
    [2.8924][3.80605:80649](),[3.80605][3.80605:80649]()
    pub fn download_changelist<T: MutTxnT>(
    [2.8924]
    [3.80649]
    pub fn download_changelist<
    A,
    F: FnMut(&mut A, u64, Hash, Merkle) -> Result<(), anyhow::Error>,
    >(
  • replacement in pijul/src/remote/local.rs at line 55
    [3.80668][3.80668:80724]()
    txn: &mut T,
    remote: &mut RemoteRef<T>,
    [3.80668]
    [3.80724]
    mut f: F,
    a: &mut A,
  • replacement in pijul/src/remote/local.rs at line 106
    [2.9387][2.9387:9453]()
    txn.put_remote(remote, n, (h.into(), m.into()))?;
    [2.9387]
    [3.82051]
    f(a, n, h.into(), m.into())?;
  • replacement in pijul/src/remote/http.rs at line 6
    [3.1221][3.5014:5100]()
    use libpijul::pristine::{Base32, MutTxnT, Position};
    use libpijul::{Hash, RemoteRef};
    [3.11135]
    [3.0]
    use libpijul::pristine::{Base32, Position};
    use libpijul::Hash;
  • replacement in pijul/src/remote/http.rs at line 168
    [3.5102][3.5102:5152]()
    pub async fn download_changelist<T: MutTxnT>(
    [3.5102]
    [3.5152]
    pub async fn download_changelist<
    A,
    F: FnMut(&mut A, u64, Hash, libpijul::Merkle) -> Result<(), anyhow::Error>,
    >(
  • replacement in pijul/src/remote/http.rs at line 173
    [3.5167][3.5167:5223]()
    txn: &mut T,
    remote: &mut RemoteRef<T>,
    [3.5167]
    [3.5223]
    mut f: F,
    a: &mut A,
  • replacement in pijul/src/remote/http.rs at line 216
    [3.6079][3.6079:6234]()
    super::ListLine::Change { n, m, h } => {
    txn.put_remote(remote, n, (h, m))?;
    }
    [3.6079]
    [3.6234]
    super::ListLine::Change { n, m, h } => f(a, n, h, m)?,
  • edit in pijul/src/commands/pushpull.rs at line 408
    [3.9951][2.15561:15614]()
    &remote_changes.as_ref().unwrap().1,
  • edit in pijul/src/commands/pushpull.rs at line 416
    [3.10154]
    [3.10154]
    if let Some((_, ref r)) = remote_changes {
    remote.update_identities(&mut repo, r).await?;
    }