Complete dependencies when pushing and pulling

[?]
Nov 22, 2020, 9:11 AM
M5FK3ABTKBDG6HHW32G7UKRJEJQKD2U7BPXNZ3HVHBKULWVV6CTQC

Dependencies

  • [2] 5HF7C67M push/pull: fixed "changes" arguments
  • [3] 76PCXGML Pushing to, and pulling from the local repository
  • [4] XWETQ4DE Upgrading versions
  • [5] BAUL3WR2 Format, versions, README
  • [6] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [7] IMCZFTIJ Update selection instructions to also mention pushing

Change contents

  • replacement in pijul/src/commands/pushpull.rs at line 217
    [2.1194][3.117021:117222](),[3.117021][3.117021:117222]()
    let o = make_changelist(&repo.changes, &to_upload)?;
    let u = parse_changelist(&edit::edit_bytes(&o[..])?);
    check_deps(&repo.changes, &to_upload, &u)?;
    u
    [2.1194]
    [3.117261]
    let mut o = make_changelist(&repo.changes, &to_upload)?;
    loop {
    let d = parse_changelist(&edit::edit_bytes(&o[..])?);
    let comp = complete_deps(&repo.changes, &to_upload, &d)?;
    if comp.len() == d.len() {
    break comp
    }
    o = make_changelist(&repo.changes, &comp)?
    }
  • replacement in pijul/src/commands/pushpull.rs at line 363
    [3.120145][3.120145:120336]()
    let o = make_changelist(&repo.changes, &to_download)?;
    let d = parse_changelist(&edit::edit_bytes(&o[..])?);
    check_deps(&repo.changes, &to_download, &d)?;
    [3.120145]
    [3.120336]
    let mut o = make_changelist(&repo.changes, &to_download)?;
    let d = loop {
    let d = parse_changelist(&edit::edit_bytes(&o[..])?);
    let comp = complete_deps(&repo.changes, &to_download, &d)?;
    if comp.len() == d.len() {
    break comp
    }
    o = make_changelist(&repo.changes, &comp)?
    };
  • edit in pijul/src/commands/pushpull.rs at line 468
    [3.122682]
    [3.122682]
    fn complete_deps<C: ChangeStore>(
    c: &C,
    original: &[libpijul::pristine::Hash],
    now: &[libpijul::pristine::Hash],
    ) -> Result<Vec<libpijul::pristine::Hash>, anyhow::Error> {
    let original_: HashSet<_> = original.iter().collect();
    let mut now_ = HashSet::new();
    let mut result = Vec::new();
    for n in now {
    // check that all of `now`'s deps are in now or not in original
    for d in c.get_dependencies(n)? {
    if original_.get(&d).is_some() && now_.get(&d).is_none() {
    result.push(d);
    now_.insert(d);
    }
    }
    now_.insert(*n);
    result.push(*n)
    }
    Ok(result)
    }