Forwarding SSH stderr, and progress bar for push
[?]
Nov 27, 2020, 6:44 PM
367UBQ6KNAKUEWG32R4QRJ6H7IE7NAZFOPTC3ZOE4Z6E44RV3ISQCDependencies
- [2]
YS2HLPX6Don't propose an empty list of changes to push - [3]
VMPAOJS2Don't output after pushing to a local channel - [4]
Q45QHPO4Feedback on network stuff - [5]
UDHP4ZVBFixing SSH asynchronicity issues - [6]
76PCXGMLPushing to, and pulling from the local repository - [7]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [*]
FBXYP7QMForgot to add remote::http - [*]
5HF7C67Mpush/pull: fixed "changes" arguments
Change contents
- edit in pijul/src/remote/ssh.rs at line 315
fn extended_data(self,channel: thrussh::ChannelId,ext: u32,data: &[u8],session: thrussh::client::Session,) -> Self::FutureUnit {if ext == 0 {self.data(channel, data, session)} else {let mut stderr = std::io::stderr();let result = stderr.write_all(data);Box::pin(async move {result?;Ok((self, session))})}} - edit in pijul/src/remote/ssh.rs at line 676
let progress = ProgressBar::new(changes.len() as u64);progress.println("Uploading changes"); - edit in pijul/src/remote/ssh.rs at line 695
progress.inc(1); - edit in pijul/src/remote/ssh.rs at line 698
progress.finish(); - replacement in pijul/src/remote/mod.rs at line 390
mut local: PathBuf,local: PathBuf, - replacement in pijul/src/remote/mod.rs at line 397
RemoteRepo::Http(ref h) => {for c in changes {libpijul::changestore::filesystem::push_filename(&mut local, &c);let url = h.url.clone() + "/" + DOT_DIR;let change = std::fs::read(&local)?;let mut to_channel = if let Some(ch) = to_channel {vec![("to_channel", ch)]} else {Vec::new()};let c = c.to_base32();to_channel.push(("apply", &c));debug!("url {:?} {:?}", url, to_channel);h.client.post(&url).query(&to_channel).body(change).send().await?;libpijul::changestore::filesystem::pop_filename(&mut local);}Ok(())}RemoteRepo::Http(ref h) => h.upload_changes(local, to_channel, changes).await, - edit in pijul/src/remote/http.rs at line 6
use log::debug; - edit in pijul/src/remote/http.rs at line 55
}Ok(())}pub async fn upload_changes(&self,mut local: PathBuf,to_channel: Option<&str>,changes: &[libpijul::Hash],) -> Result<(), anyhow::Error> {let progress = ProgressBar::new(changes.len() as u64);progress.println("Uploading changes");for c in changes {libpijul::changestore::filesystem::push_filename(&mut local, &c);let url = self.url.clone() + "/" + super::DOT_DIR;let change = std::fs::read(&local)?;let mut to_channel = if let Some(ch) = to_channel {vec![("to_channel", ch)]} else {Vec::new()};let c = c.to_base32();to_channel.push(("apply", &c));debug!("url {:?} {:?}", url, to_channel);self.client.post(&url).query(&to_channel).body(change).send().await?;progress.inc(1);libpijul::changestore::filesystem::pop_filename(&mut local); - edit in pijul/src/remote/http.rs at line 88
progress.finish(); - edit in pijul/src/commands/pushpull.rs at line 118
let mut stderr = std::io::stderr(); - edit in pijul/src/commands/pushpull.rs at line 213
writeln!(stderr, "Nothing to push")?; - edit in pijul/src/commands/pushpull.rs at line 257[10.1230][10.1230]
writeln!(stderr, "Nothing to push")?;