Complete dependencies when pushing and pulling
[?]
Nov 22, 2020, 9:11 AM
M5FK3ABTKBDG6HHW32G7UKRJEJQKD2U7BPXNZ3HVHBKULWVV6CTQCDependencies
- [2]
5HF7C67Mpush/pull: fixed "changes" arguments - [3]
XWETQ4DEUpgrading versions - [4]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [5]
BAUL3WR2Format, versions, README - [6]
76PCXGMLPushing to, and pulling from the local repository - [7]
IMCZFTIJUpdate selection instructions to also mention pushing
Change contents
- replacement in pijul/src/commands/pushpull.rs at line 217
let o = make_changelist(&repo.changes, &to_upload)?;let u = parse_changelist(&edit::edit_bytes(&o[..])?);check_deps(&repo.changes, &to_upload, &u)?;ulet 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
let o = make_changelist(&repo.changes, &to_download)?;let d = parse_changelist(&edit::edit_bytes(&o[..])?);check_deps(&repo.changes, &to_download, &d)?;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
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 originalfor 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)}