Dependencies completion in push and pull, updated after stabilisation of remote caches

pmeunier
Sep 14, 2021, 8:22 AM
3OW3YNZXF6DR2EI5XS7PDHUUZMARDU2JUJFJKIEWXQNSMCIBVAOQC

Dependencies

  • [2] 7HOBLRD4 Fixing remote push/pull
  • [3] Q45QHPO4 Feedback on network stuff
  • [4] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [5] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [6] YN63NUZO Sanakirja 1.0
  • [7] IVLLXQ5Z Improved push/pull reporting
  • [8] BBKV6VMN Fixing push/pull messages, and do not reverse the changes to download/upload
  • [9] I52XSRUH Massive cleanup, and simplification
  • [10] BE7GUCI2 Completing dependencies only with changes the remote does not have
  • [11] SLJ3OHD4 unrecord: show list of changes if none were given as arguments
  • [12] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [13] M5FK3ABT Complete dependencies when pushing and pulling
  • [14] 6WFOU7UX Do a DFS on dependencies to complete the list
  • [15] 44BN7FWS Do not output files introduced by patches that were not applied during a push
  • [16] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • edit in "pijul/src/commands/pushpull.rs" at line 221
    [3.20240][3.20240:20264]()
    remote_ref,
  • edit in "pijul/src/commands/pushpull.rs" at line 224
    [3.20343]
    [3.20343]
    ..
  • replacement in "pijul/src/commands/pushpull.rs" at line 277
    [3.158][2.902:991]()
    let comp = complete_deps(&*txn.read(), &remote_ref, &repo.changes, &d)?;
    [3.158]
    [3.232]
    let comp = complete_deps(&repo.changes, &to_upload, &d)?;
  • replacement in "pijul/src/commands/pushpull.rs" at line 421
    [3.566][2.992:1075]()
    let comp = complete_deps(&*txn.read(), &None, &repo.changes, &d)?;
    [3.566]
    [3.642]
    let comp = complete_deps(&repo.changes, &to_download, &d)?;
  • replacement in "pijul/src/commands/pushpull.rs" at line 554
    [3.122682][3.188:297]()
    fn complete_deps<T: TxnT, C: ChangeStore>(
    txn: &T,
    remote_changes: &Option<libpijul::RemoteRef<T>>,
    [3.121148]
    [3.843]
    fn complete_deps<C: ChangeStore>(
  • edit in "pijul/src/commands/pushpull.rs" at line 556
    [3.854]
    [3.2859]
    original: &[libpijul::Hash],
  • replacement in "pijul/src/commands/pushpull.rs" at line 559
    [3.2937][2.1076:1171]()
    let mut now_ = HashSet::new();
    let mut result = Vec::new();
    for &h in now.iter() {
    [3.2937]
    [2.1171]
    let original: HashSet<_> = original.iter().collect();
    let mut now_ = HashSet::with_capacity(original.len());
    let mut result = Vec::with_capacity(original.len());
    let mut stack: Vec<_> = now.iter().rev().cloned().collect();
    while let Some(h) = stack.pop() {
    stack.push(h);
    let l0 = stack.len();
  • replacement in "pijul/src/commands/pushpull.rs" at line 567
    [3.327][3.298:350](),[2.1214][3.298:350](),[3.1255][3.298:350](),[3.350][3.12121:12181](),[3.12181][3.401:463](),[3.15077][3.401:463](),[3.401][3.401:463](),[3.463][2.1215:1247](),[2.1247][3.1326:1358](),[3.1326][3.1326:1358](),[3.1358][2.1248:1274]()
    if let Some(ref rem) = remote_changes {
    if txn.remote_has_change(rem, &d.into())? {
    continue;
    }
    }
    if now_.insert(d) {
    result.push(d);
    continue;
    [2.1214]
    [3.1390]
    if original.get(&d).is_some() && now_.get(&d).is_none() {
    // The user missed a dep.
    stack.push(d);
  • replacement in "pijul/src/commands/pushpull.rs" at line 572
    [3.1414][2.1275:1330]()
    if now_.insert(h) {
    result.push(h)
    [3.1414]
    [3.2286]
    if stack.len() == l0 {
    // We have all dependencies.
    stack.pop();
    if now_.insert(h) {
    result.push(h);
    }