Cursors cleanup

[?]
Mar 1, 2021, 8:19 AM
GNMZNKB46GTPTWBR452FITHPBCMYPSDLV5VZQSY7BX6OJHWTWTZAC

Dependencies

  • [2] MXQ3U2DP Shorter progress bars
  • [3] YN63NUZO Sanakirja 1.0
  • [4] SAGSYAPX Various version bumps
  • [5] Q45QHPO4 Feedback on network stuff
  • [6] BNPSVXIC Friendlier progress bars
  • [7] WTZXEWY7 Flushing the futures pipeline when downloading over HTTP(S)
  • [8] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [9] VBMXB443 Retrying if the HTTP connection drops while reading the body
  • [10] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [11] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [12] WLUID7NA Do not block when downloading more than 100 changes over SSH
  • [13] TKEVOH7H Fixing a bug when downloading changes, and making change download more efficient (more async)
  • [14] UDHP4ZVB Fixing SSH asynchronicity issues
  • [*] FBXYP7QM Forgot to add remote::http

Change contents

  • replacement in pijul/src/remote/ssh.rs at line 810
    [3.738][3.738:798]()
    progress.lock().unwrap().cursors[0].incr();
    [3.738]
    [3.798]
    progress.lock().unwrap()[0].incr();
  • replacement in pijul/src/remote/mod.rs at line 367
    [3.2247][3.2247:2307]()
    pro.cursors.push(crate::progress::Cursor::Bar {
    [3.2247]
    [3.2307]
    pro.push(crate::progress::Cursor::Bar {
  • replacement in pijul/src/remote/mod.rs at line 373
    [3.2457][3.2457:2521]()
    pro.cursors.push(crate::progress::Cursor::Bar {
    [3.2457]
    [3.2521]
    pro.push(crate::progress::Cursor::Bar {
  • replacement in pijul/src/remote/mod.rs at line 457
    [3.1015][3.3501:3567]()
    progress.inner.lock().unwrap().cursors[1].incr();
    [3.1015]
    [3.3567]
    progress.inner.lock().unwrap()[1].incr();
  • replacement in pijul/src/remote/local.rs at line 137
    [3.3058][3.4751:4807]()
    progress.lock().unwrap().cursors[0].incr();
    [3.3058]
    [3.12057]
    progress.lock().unwrap()[0].incr();
  • replacement in pijul/src/remote/http.rs at line 97
    [3.5078][3.5078:5138]()
    progress.lock().unwrap().cursors[0].incr();
    [3.5078]
    [3.902]
    progress.lock().unwrap()[0].incr();
  • replacement in pijul/src/remote/http.rs at line 110
    [3.5215][3.5215:5275]()
    progress.lock().unwrap().cursors[0].incr();
    [3.5215]
    [3.239]
    progress.lock().unwrap()[0].incr();
  • replacement in pijul/src/progress.rs at line 12
    [3.5541][3.5541:5571]()
    pub cursors: Vec<Cursor>,
    [3.5541]
    [3.5571]
    cursors: Vec<Cursor>,
  • edit in pijul/src/progress.rs at line 17
    [3.5638]
    [3.5638]
    }
    impl std::ops::Index<usize> for InnerCursors {
    type Output = Cursor;
    fn index(&self, i: usize) -> &Self::Output {
    self.cursors.index(i)
    }
    }
    impl std::ops::IndexMut<usize> for InnerCursors {
    fn index_mut(&mut self, i: usize) -> &mut Self::Output {
    self.cursors.index_mut(i)
    }
  • replacement in pijul/src/progress.rs at line 163
    [2.47][2.47:144](),[2.144][3.8911:9147](),[3.8911][3.8911:9147]()
    let k = (wb as usize * *i) / (*n - 1);
    for j in 0..wb as usize {
    if j < k {
    write!(stdout, "=")?;
    } else if j == k {
    write!(stdout, ">")?;
    } else {
    write!(stdout, " ")?
    [2.47]
    [3.9147]
    if *n <= 1 {
    for _ in 0..wb as usize {
    if *i == 1 {
    write!(stdout, "=")?;
    } else {
    write!(stdout, " ")?
    }
    }
    } else {
    let k = (wb as usize * *i) / (*n - 1);
    for j in 0..wb as usize {
    if j < k {
    write!(stdout, "=")?;
    } else if j == k {
    write!(stdout, ">")?;
    } else {
    write!(stdout, " ")?
    }
  • edit in pijul/src/progress.rs at line 223
    [3.10451]
    [3.10451]
    pub fn push(&mut self, c: Cursor) -> usize {
    let r = self.cursors.len();
    self.cursors.push(c);
    r
    }
  • edit in Cargo.lock at line 1388
    [3.1067656][3.13469:13555]()
    name = "progress"
    version = "0.1.0"
    dependencies = [
    "terminal_size",
    ]
    [[package]]