Fixing known patches in deleted contexts

pmeunier
Apr 30, 2022, 7:41 AM
ZJWCPRMHAYZYGCPYBTBIPBBFVCVDSFNGUL36HMC2DHCWZZKNA7PAC

Dependencies

  • [2] ZDK3GNDB Tag transactions (including a massive refactoring of errors)
  • [3] 422NG2MT Fixing a confusion on filename conflicts, where some names could be mistakenly treated as zombies
  • [4] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [5] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [6] GVQ7YSED Checking for dependencies even for a local change
  • [7] I52XSRUH Massive cleanup, and simplification
  • [8] YN63NUZO Sanakirja 1.0
  • [9] IXC43DSH Fixing a bug in unrecord
  • [10] 43AJ37IX Getting rid of edge validation, which does not work for zombie conflicts
  • [11] 6YMDOZIB Refactoring apply
  • [12] I24UEJQL Various post-fire fixes
  • [13] 5SLOJYHG Fixing the Git feature
  • [14] HMMMKONL Fixing alive vertices
  • [15] VO5OQW4W Removing anyhow in libpijul
  • [16] GHO6DWPI Refactoring iterators

Change contents

  • edit in libpijul/src/unrecord/mod.rs at line 180
    [4.24110][4.30164:30188]()
    change,
  • edit in libpijul/src/unrecord/mod.rs at line 391
    [4.240533][4.30189:30210]()
    change: &Change,
  • edit in libpijul/src/unrecord/mod.rs at line 434
    [4.1099]
    [4.240757]
    let hash: Hash = (*txn.get_external(&change_id).unwrap().unwrap()).into();
  • replacement in libpijul/src/unrecord/mod.rs at line 445
    [4.1146][4.30211:30244](),[4.241619][4.30211:30244]()
    |h| change.knows(h),
    [4.1146]
    [4.241619]
    |h| {
    if edge.previous.contains(EdgeFlags::DELETED) {
    // When reintroducing a deleted flag, check whether
    // the re-introduction patch knows about the alive
    // edges around the target.
    changes
    .knows(edge.introduced_by.as_ref().unwrap_or(&hash), h)
    .unwrap()
    } else {
    // When the edge we are re-introducing is not a
    // deletion edge, this check isn't actually used: the
    // only zombies in that case are from a deleted
    // context, and these aren't detected with known
    // patches.
    true
    }
    },
  • replacement in libpijul/src/apply.rs at line 176
    [4.945713][2.41267:41406]()
    Ok(
    apply_change_to_channel(txn, channel, internal, &hash, &change, workspace)
    .map_err(ApplyError::LocalChange)?,
    [4.945713]
    [2.41406]
    Ok(apply_change_to_channel(
    txn,
    channel,
    &mut |h| changes.knows(h, hash).unwrap(),
    internal,
    &hash,
    &change,
    workspace,
  • edit in libpijul/src/apply.rs at line 185
    [2.41412]
    [4.945917]
    .map_err(ApplyError::LocalChange)?)
  • replacement in libpijul/src/apply.rs at line 239
    [4.947384][2.41457:41604]()
    apply_change_to_channel(txn, channel, internal, &hash, &change, workspace)
    .map_err(ApplyError::LocalChange)?;
    [4.947384]
    [4.947698]
    apply_change_to_channel(
    txn,
    channel,
    &mut |h| changes.knows(h, &hash).unwrap(),
    internal,
    &hash,
    &change,
    workspace,
    )
    .map_err(ApplyError::LocalChange)?;
  • replacement in libpijul/src/apply.rs at line 299
    [4.948456][2.41759:41817]()
    fn apply_change_to_channel<T: ChannelMutTxnT + TreeTxnT>(
    [4.948456]
    [4.948727]
    fn apply_change_to_channel<T: ChannelMutTxnT + TreeTxnT, F: FnMut(&Hash) -> bool>(
  • edit in libpijul/src/apply.rs at line 302
    [4.64811]
    [4.948774]
    changes: &mut F,
  • replacement in libpijul/src/apply.rs at line 323
    [4.949433][4.125802:125846](),[4.125846][4.64950:65039](),[4.65039][4.125932:125950](),[4.125932][4.125932:125950]()
    Atom::NewVertex(ref n) => {
    put_newvertex(txn, T::graph_mut(channel), change, ws, change_id, n)?
    }
    [4.949433]
    [4.949531]
    Atom::NewVertex(ref n) => put_newvertex(
    txn,
    T::graph_mut(channel),
    changes,
    change,
    ws,
    change_id,
    n,
    )?,
  • replacement in libpijul/src/apply.rs at line 424
    [4.96399][4.227:321](),[4.127224][4.227:321](),[4.144461][4.227:321](),[4.67381][4.227:321]()
    let n = apply_change_to_channel(txn, &mut channel, internal, &hash, &change, workspace)?;
    [4.144461]
    [4.953210]
    let n = apply_change_to_channel(
    txn,
    &mut channel,
    &mut |_| true,
    internal,
    &hash,
    &change,
    workspace,
    )?;
  • replacement in libpijul/src/apply/vertex.rs at line 6
    [4.90614][2.43140:43190]()
    pub fn put_newvertex<T: GraphMutTxnT + TreeTxnT>(
    [4.90614]
    [4.90653]
    pub fn put_newvertex<T: GraphMutTxnT + TreeTxnT, F: FnMut(&Hash) -> bool>(
  • edit in libpijul/src/apply/vertex.rs at line 9
    [4.90696]
    [4.90696]
    changes: &mut F,
  • replacement in libpijul/src/apply/vertex.rs at line 33
    [4.91421][4.91421:91512]()
    if put_up_context(txn, graph, ch, ws, up)? && n.flag.contains(EdgeFlags::FOLDER) {
    [4.91421]
    [4.91512]
    if put_up_context(txn, graph, changes, ws, up)? && n.flag.contains(EdgeFlags::FOLDER) {
  • replacement in libpijul/src/apply/vertex.rs at line 74
    [4.92874][2.43230:43277]()
    fn put_up_context<T: GraphMutTxnT + TreeTxnT>(
    [4.92874]
    [4.92910]
    fn put_up_context<T: GraphMutTxnT + TreeTxnT, F: FnMut(&Hash) -> bool>(
  • replacement in libpijul/src/apply/vertex.rs at line 77
    [4.92953][4.92953:92970]()
    ch: &Change,
    [4.92953]
    [4.92970]
    knows: &mut F,
  • replacement in libpijul/src/apply/vertex.rs at line 114
    [4.94393][4.94393:94436]()
    if !ch.knows(&introduced_by) {
    [4.94393]
    [4.94436]
    if !knows(&introduced_by) {
  • edit in libpijul/src/apply/edge.rs at line 86
    [4.98589]
    [3.855]
    debug!("putting zombie {:?} {:?} {:?}", source, target, intro);
  • edit in libpijul/src/apply/edge.rs at line 146
    [4.100159]
    [4.100159]
    debug!("known {:?} ?", intro);