Feedback on network stuff

[?]
Nov 27, 2020, 6:13 PM
Q45QHPO4HDTEZF2W4UDZSYYQ46BPEIWSW4GJILZR5HTJNLKXJABQC

Dependencies

  • [2] 3WIQYEIS Fixing conflicts in Cargo.lock
  • [3] I52XSRUH Massive cleanup, and simplification
  • [4] L4LAD4XM Fixing clone on WSL (Windows Subsystem for Linux)
  • [5] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [6] FBXYP7QM Forgot to add remote::http
  • [7] QE64ATLZ Fixing asynchronicity problems in SSH
  • [8] UDHP4ZVB Fixing SSH asynchronicity issues
  • [9] M5FK3ABT Complete dependencies when pushing and pulling
  • [10] L4JXJHWX pijul/*: reorganize imports and remove extern crate

Change contents

  • edit in pijul/src/remote/ssh.rs at line 9
    [5.126]
    [5.126]
    use indicatif::ProgressBar;
  • edit in pijul/src/remote/ssh.rs at line 713
    [5.9753]
    [5.9753]
    let progress = ProgressBar::new(c.len() as u64);
    progress.println("Downloading changes");
  • edit in pijul/src/remote/ssh.rs at line 717
    [5.9854]
    [5.9854]
    progress.inc(1);
  • edit in pijul/src/remote/ssh.rs at line 719
    [5.9905]
    [3.378]
    progress.abandon();
  • edit in pijul/src/remote/ssh.rs at line 722
    [5.49743]
    [5.49743]
    }
    if !progress.is_finished() {
    progress.finish();
  • edit in pijul/src/remote/ssh.rs at line 745
    [5.10128]
    [5.50173]
    let progress = indicatif::ProgressBar::new_spinner();
    progress.set_style(
    indicatif::ProgressStyle::default_spinner().template("{spinner} Cloning channel"),
    );
    progress.enable_steady_tick(100);
  • edit in pijul/src/remote/ssh.rs at line 764
    [5.51338]
    [5.51338]
    progress.finish();
  • replacement in pijul/src/remote/mod.rs at line 7
    [5.52659][5.440:456]()
    use log::debug;
    [5.52659]
    [5.456]
    use log::{debug, info};
  • edit in pijul/src/remote/mod.rs at line 466
    [5.69865]
    [5.69865]
    let progress = if do_apply {
    let p = indicatif::ProgressBar::new(to_download.len() as u64);
    p.println("Applying changes");
    Some(p)
    } else {
    None
    };
  • edit in pijul/src/remote/mod.rs at line 481
    [5.70253]
    [5.70253]
    if let Some(ref progress) = progress {
    progress.abandon();
    }
  • replacement in pijul/src/remote/mod.rs at line 488
    [5.70391][5.70391:70519]()
    if do_apply {
    println!("Applying {:?}", h.to_base32());
    debug!("applying {:?}", h);
    [5.70391]
    [5.70519]
    if let Some(ref progress) = progress {
    info!("Applying {:?}", h);
    progress.inc(1);
  • edit in pijul/src/remote/mod.rs at line 496
    [5.70686]
    [5.70686]
    if let Some(progress) = progress {
    if !progress.is_finished() {
    progress.finish()
    }
    }
  • edit in pijul/src/remote/http.rs at line 1
    [5.10][3.1048:1080]()
    use libpijul::pristine::Base32;
  • edit in pijul/src/remote/http.rs at line 3
    [5.55]
    [5.87]
    use indicatif::ProgressBar;
    use libpijul::pristine::Base32;
  • edit in pijul/src/remote/http.rs at line 22
    [3.1338]
    [5.432]
    let progress = ProgressBar::new(hashes.len() as u64);
    progress.println("Downloading changes");
  • edit in pijul/src/remote/http.rs at line 46
    [5.1267]
    [5.1267]
    progress.inc(1);
  • edit in pijul/src/remote/http.rs at line 48
    [5.1313]
    [3.1613]
    progress.abandon();
  • edit in pijul/src/remote/http.rs at line 52
    [5.1359]
    [5.1359]
    if !progress.is_finished() {
    progress.finish();
    }
  • edit in pijul/src/commands/pushpull.rs at line 156
    [5.115743]
    [5.115743]
    let progress = indicatif::ProgressBar::new_spinner();
    progress.set_style(
    indicatif::ProgressStyle::default_spinner()
    .template("{spinner} Updating remote changelist"),
    );
    progress.enable_steady_tick(100);
  • edit in pijul/src/commands/pushpull.rs at line 163
    [5.115823]
    [5.115823]
    progress.finish();
  • edit in pijul/src/commands/pushpull.rs at line 303
    [5.118637]
    [5.118637]
    let progress = indicatif::ProgressBar::new_spinner();
    progress.set_style(
    indicatif::ProgressStyle::default_spinner()
    .template("{spinner} Updating remote changelist"),
    );
    progress.enable_steady_tick(100);
  • edit in pijul/src/commands/pushpull.rs at line 310
    [5.118721]
    [5.118721]
    progress.finish();
  • edit in pijul/src/commands/pushpull.rs at line 364
    [5.119467]
    [5.119467]
    let mut stderr = std::io::stderr();
    writeln!(stderr, "Nothing to pull")?;
  • replacement in pijul/src/commands/pushpull.rs at line 512
    [5.1414][5.1414:1463]()
    now_.insert(*n);
    result.push(*n)
    [5.1414]
    [5.1463]
    if now_.insert(*n) {
    result.push(*n)
    }
  • edit in pijul/src/commands/clone.rs at line 1
    [5.182891]
    [5.2900]
    use std::io::Write;
  • edit in pijul/src/commands/clone.rs at line 87
    [5.185601]
    [5.185601]
    let progress = indicatif::ProgressBar::new_spinner();
    progress.set_style(
    indicatif::ProgressStyle::default_spinner().template("{spinner} Outputting repository"),
    );
    progress.enable_steady_tick(100);
  • edit in pijul/src/commands/clone.rs at line 101
    [5.185801]
    [5.185801]
    progress.finish();
  • replacement in pijul/src/commands/clone.rs at line 105
    [4.30][5.185888:185940](),[5.185888][5.185888:185940]()
    std::fs::rename(&temp.into_path(), &path)?;
    [4.30]
    [5.185940]
    let temp = temp.into_path();
    if let Err(e) = std::fs::rename(&temp, &path) {
    let mut stderr = std::io::stderr();
    writeln!(stderr, "{}", e)?;
    std::fs::remove_dir_all(temp).unwrap_or(());
    }
  • edit in pijul/Cargo.toml at line 77
    [5.198127]
    indicatif = "0.15"
  • edit in libpijul/src/tests/add_file.rs at line 148
    [5.459214]
    [5.459214]
    Ok(())
    }
    /// Test that `record` notices the deletion of a file.
    #[test]
    fn del_obsolete_test() -> Result<(), anyhow::Error> {
    env_logger::try_init().unwrap_or(());
    let mut repo = working_copy::memory::Memory::new();
    let changes = changestore::memory::Memory::new();
    let env = pristine::sanakirja::Pristine::new_anon()?;
    let mut txn = env.mut_txn_begin();
    txn.add_file("a/b/c/d/e")?;
    let mut channel = txn.open_or_create_channel("main")?;
    repo.add_file("a/b/c/d/e", b"a\nb\nc\nd\ne\nf\n".to_vec());
    record_all_output(&mut repo, &changes, &mut txn, &mut channel, "")?;
    debug_to_file(&txn, &channel, "debug0").unwrap();
    let files: Vec<_> = crate::fs::iter_working_copy(&txn, Inode::ROOT)
    .map(|(_, file)| file)
    .collect();
    assert_eq!(files, vec!["a", "a/b", "a/b/c", "a/b/c/d", "a/b/c/d/e"]);
    repo.remove_path("a/b/c")?;
    debug!("Recording the deletion");
    record_all_output(&mut repo, &changes, &mut txn, &mut channel, "")?;
    debug_to_file(&txn, &channel, "debug").unwrap();
    let mut repo2 = working_copy::memory::Memory::new();
    output::output_repository_no_pending(&mut repo2, &changes, &mut txn, &mut channel, "", true)?;
    assert_eq!(repo2.list_files(), vec!["a", "a/b"]);
    let files: Vec<_> = crate::fs::iter_working_copy(&txn, Inode::ROOT)
    .map(|(_, name)| name)
    .collect();
    debug!("files = {:?}", files);
    assert_eq!(files, vec!["a", "a/b"]);
  • edit in libpijul/src/change.rs at line 2216
    [5.910672]
    [5.910672]
    debug!("edit {:?}", h);
  • edit in libpijul/src/change.rs at line 2409
    [5.918425]
    [5.918425]
    debug!("inconsistent change: {:?} {:?}", s, offsets);
  • edit in Cargo.lock at line 308
    [5.1038025]
    [2.390]
    ]
    [[package]]
    name = "console"
    version = "0.13.0"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "a50aab2529019abfabfa93f1e6c41ef392f91fbf179b347a7e96abb524884a08"
    dependencies = [
    "encode_unicode",
    "lazy_static",
    "libc",
    "regex",
    "terminal_size",
    "unicode-width",
    "winapi 0.3.9",
    "winapi-util",
  • edit in Cargo.lock at line 486
    [5.1042002]
    [5.1042002]
    name = "encode_unicode"
    version = "0.3.6"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
    [[package]]
  • edit in Cargo.lock at line 974
    [5.1052827]
    [5.1052827]
    name = "indicatif"
    version = "0.15.0"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4"
    dependencies = [
    "console",
    "lazy_static",
    "number_prefix",
    "regex",
    ]
    [[package]]
  • edit in Cargo.lock at line 1358
    [5.1061507]
    [5.1061507]
    name = "number_prefix"
    version = "0.3.0"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a"
    [[package]]
  • edit in Cargo.lock at line 1488
    [5.1064313]
    [5.1064313]
    "indicatif",
  • edit in Cargo.lock at line 2014
    [5.1076805]
    [5.1076805]
    ]
    [[package]]
    name = "terminal_size"
    version = "0.1.15"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "4bd2d183bd3fac5f5fe38ddbeb4dc9aec4a39a9d7d59e7491d900302da01cbe1"
    dependencies = [
    "libc",
    "winapi 0.3.9",