Pushing/pulling from/to Nest discussions again

pmeunier
Aug 3, 2021, 9:16 PM
27RZYCM3XP72CW7FYGE373YAFD6EEZOZ4YAHEKV6JE5L6Z5N3JNAC

Dependencies

  • [2] 3ZAS64J6 Solving conflicts
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [5] UDHP4ZVB Fixing SSH asynchronicity issues
  • [6] K6GWUOD5 Styling progress bars
  • [7] 2V33SO6I dont unwrap name() for RemoteRepo::LocalChannel
  • [8] IVLLXQ5Z Improved push/pull reporting
  • [9] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [10] 76PCXGML Pushing to, and pulling from the local repository
  • [11] KI2AFWOS Fixing a panic in pull
  • [12] FGVTXN52 Filter linebreak from http::get_state() response
  • [13] FE5ES6Q4 Stop pushing/pulling if the remote returns an error
  • [14] C5XGFNKI Simplify return type for remote get_id
  • [15] A3RM526Y Integrating identity malleability
  • [*] FBXYP7QM Forgot to add remote::http

Change contents

  • replacement in pijul/src/remote/ssh.rs at line 738
    [3.37998][3.0:92]()
    pub async fn get_id(&mut self) -> Result<libpijul::pristine::RemoteId, anyhow::Error> {
    [3.37998]
    [3.4027]
    pub async fn get_id(&mut self) -> Result<Option<libpijul::pristine::RemoteId>, anyhow::Error> {
  • replacement in pijul/src/remote/ssh.rs at line 747
    [3.4320][3.93:220]()
    receiver
    .await?
    .ok_or_else(|| anyhow::anyhow!("Unable to retrieve RemoteId for Ssh remote"))
    [3.4320]
    [3.4348]
    Ok(receiver.await?)
  • replacement in pijul/src/remote/mod.rs at line 421
    [3.56888][2.0:42]()
    let id = self.get_id(txn).await?;
    [3.56888]
    [3.0]
    let id = if let Some(id) = self.get_id(txn).await? {
    id
    } else {
    return Ok(None);
    };
  • replacement in pijul/src/remote/mod.rs at line 489
    [3.11453][2.44:86]()
    let id = self.get_id(txn).await?;
    [3.11453]
    [3.11504]
    let id = if let Some(id) = self.get_id(txn).await? {
    id
    } else {
    let (inodes, theirs_ge_dichotomy) = self.download_changelist_nocache(0, path).await?;
    let mut theirs_ge_dichotomy_set = HashSet::new();
    let mut to_download = Vec::new();
    for (_, h, _) in theirs_ge_dichotomy.iter() {
    theirs_ge_dichotomy_set.insert(*h);
    to_download.push(*h);
    }
    return Ok(RemoteDelta {
    inodes,
    remote_ref: None,
    to_download,
    ours_ge_dichotomy_set: HashSet::new(),
    theirs_ge_dichotomy,
    theirs_ge_dichotomy_set,
    remote_unrecs: Vec::new(),
    });
    };
  • edit in pijul/src/remote/mod.rs at line 746
    [3.6651]
    [3.6651]
    /// This method might return `Ok(None)` in some cases, for example
    /// if the remote wants to indicate not to store a cache. This is
    /// the case for Nest channels, for example.
  • replacement in pijul/src/remote/mod.rs at line 752
    [3.6730][3.264:327]()
    ) -> Result<libpijul::pristine::RemoteId, anyhow::Error> {
    [3.6730]
    [3.6801]
    ) -> Result<Option<libpijul::pristine::RemoteId>, anyhow::Error> {
  • replacement in pijul/src/remote/mod.rs at line 754
    [3.6823][3.6823:6875]()
    RemoteRepo::Local(ref l) => l.get_id(),
    [3.6823]
    [3.6875]
    RemoteRepo::Local(ref l) => Ok(Some(l.get_id()?)),
  • replacement in pijul/src/remote/mod.rs at line 759
    [3.7116][3.328:378]()
    Ok(*txn.id(&*channel.read()))
    [3.7116]
    [3.2110]
    Ok(Some(*txn.id(&*channel.read())))
  • replacement in pijul/src/remote/mod.rs at line 1095
    [3.73272][3.522:564]()
    let id = self.get_id(txn).await?;
    [3.73272]
    [3.73272]
    let id = if let Some(id) = self.get_id(txn).await? {
    id
    } else {
    return Ok(());
    };
  • replacement in pijul/src/remote/http.rs at line 295
    [3.1310][3.803:891]()
    pub async fn get_id(&self) -> Result<libpijul::pristine::RemoteId, anyhow::Error> {
    [3.1310]
    [3.10538]
    pub async fn get_id(&self) -> Result<Option<libpijul::pristine::RemoteId>, anyhow::Error> {
  • replacement in pijul/src/remote/http.rs at line 311
    [3.11088][3.892:1039]()
    libpijul::pristine::RemoteId::from_bytes(&resp)
    .ok_or_else(|| anyhow::anyhow!("Unable to retrieve RemoteId for Http remote"))
    [3.11088]
    [3.11148]
    Ok(libpijul::pristine::RemoteId::from_bytes(&resp))