Stop pushing/pulling if the remote returns an error

[?]
Dec 11, 2020, 9:38 PM
FE5ES6Q46FMWYPNNNJLORY377QGDE57LBBDIVWDTC6Z7U4U73NEQC

Dependencies

  • [2] 5QTMRUXN Fixing a race condition between progress bars
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] 76PCXGML Pushing to, and pulling from the local repository
  • [5] K6GWUOD5 Styling progress bars
  • [*] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [*] UDHP4ZVB Fixing SSH asynchronicity issues
  • [*] SZWBLWZ4 Reading ~/.ssh/config
  • [*] KTTKF3RW Locking stderr and the progress bar in SSH
  • [*] Q45QHPO4 Feedback on network stuff

Change contents

  • edit in pijul/src/remote/ssh.rs at line 7
    [7.84]
    [7.84]
    use anyhow::bail;
  • edit in pijul/src/remote/ssh.rs at line 30
    [8.75]
    [3.26002]
    has_errors: Arc<Mutex<bool>>,
  • edit in pijul/src/remote/ssh.rs at line 79
    [8.131]
    [3.27527]
    let has_errors = Arc::new(Mutex::new(false));
  • edit in pijul/src/remote/ssh.rs at line 85
    [8.166]
    [3.27683]
    has_errors: has_errors.clone(),
  • edit in pijul/src/remote/ssh.rs at line 120
    [8.186]
    [3.28790]
    has_errors,
  • edit in pijul/src/remote/ssh.rs at line 241
    [8.217]
    [8.217]
    has_errors: Arc<Mutex<bool>>,
  • edit in pijul/src/remote/ssh.rs at line 326
    [9.2121]
    [9.2121]
    self,
    _channel: thrussh::ChannelId,
    session: thrussh::client::Session,
    ) -> Self::FutureUnit {
    Box::pin(async move {
    *self.state.lock().await = State::None;
    Ok((self, session))
    })
    }
    fn exit_status(
  • edit in pijul/src/remote/ssh.rs at line 339
    [9.2173]
    [9.2173]
    _status: u32,
  • edit in pijul/src/remote/ssh.rs at line 344
    [9.2326]
    [9.2326]
    *self.has_errors.lock().await = true;
  • edit in pijul/src/remote/ssh.rs at line 363
    [10.194]
    [10.194]
    *super::SPINNER.lock().await = None;
    *self.has_errors.lock().await = true;
  • edit in pijul/src/remote/ssh.rs at line 698
    [3.44272]
    [3.44272]
    if *self.has_errors.lock().await {
    bail!("Remote sent an error")
    }
  • edit in pijul/src/remote/mod.rs at line 9
    [11.573]
    [7.456]
    use tokio::sync::Mutex;
  • edit in pijul/src/remote/mod.rs at line 33
    [2.512]
    [3.52848]
    static ref SPINNER: Arc<Mutex<Option<indicatif::ProgressBar>>> = Arc::new(Mutex::new(None));
  • edit in pijul/src/remote/mod.rs at line 173
    [3.737]
    [3.56851]
    *SPINNER.lock().await = Some(progress);
  • replacement in pijul/src/remote/mod.rs at line 194
    [3.57497][3.738:904]()
    progress.set_style(
    indicatif::ProgressStyle::default_spinner().template("✓ Updating remote changelist"),
    );
    progress.finish();
    [3.57497]
    [3.1637]
    if let Some(progress) = SPINNER.lock().await.take() {
    progress.set_style(
    indicatif::ProgressStyle::default_spinner()
    .template("✓ Updating remote changelist"),
    );
    progress.finish();
    }