X7OHUPL5VYT6ECER2KNGRNFLRX7SBZOM5QWSQ4PBO2UPIE7XM6MAC
CD6XDYOHYK6FZDJLIE3AEC5U3YXT3O57VECRDF3KVDK3RHYYS7IQC
IIV3EL2XYI2X7HZWKXEXQFAE3R3KC2Q7SGOT3Q332HSENMYVF32QC
SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC
CCLLB7OIFNFYJZTG3UCI7536TOCWSCSXR67VELSB466R24WLJSDAC
YN63NUZO4LVJ7XPMURDULTXBVJKW5MVCTZ24R7Z52QMHO3HPDUVQC
GHO6DWPILBBTL6CVZKERJBTFL3EY6ZT4YM4E5R4S6YPGVFKFHCVAC
VO5OQW4W2656DIYYRNZ3PO7TQ4JOKQ3GVWE5ALUTYVMX3WMXJOYQC
6YMDOZIB5LVYLFIDGN2WNT5JTHEAMS4TFPVDEZ3OWXWOKJOC5QDAC
JACZYXK43IU5HWLHQBY3BOAE7CUO6NGEXQ3HSZL3CQP3SLGKMBOAC
if deleted_by_unknown(txn, channel, source, change_id, &mut known)? {
debug!("deleted by unknown, repairing {:?}", source);
repair_missing_up_context(txn, channel, ws, change_id, inode, source, &[target])?;
}
repair_missing_up_context(txn, channel, ws, change_id, inode, source, &[target])?;
}
fn deleted_by_unknown<T: GraphTxnT, K>(
txn: &T,
channel: &T::Graph,
source: Vertex<ChangeId>,
change_id: ChangeId,
known: &mut K,
) -> Result<bool, TxnErr<T::GraphError>>
where
K: FnMut(Hash) -> bool,
{
let mut deleted_by_unknown = false;
for v in iter_deleted_parents(txn, channel, source)? {
let v = v?;
if v.dest().change.is_root() || v.introduced_by().is_root() {
continue;
}
if v.introduced_by() == change_id
|| known(txn.get_external(&v.introduced_by())?.unwrap().into())
{
// If a known change also delete the context, we're good.
return Ok(false);
} else {
// If an unknown change deletes the context, wait: maybe a
// known change will delete it too.
deleted_by_unknown = true;
}
}
Ok(deleted_by_unknown)
repair_context_nondeleted(
txn,
channel,
&mut ws.missing_context,
n.inode,
change_id,
|h| change.knows(&h),
e,
)
.map_err(LocalApplyError::from_missing)?
repair_context_nondeleted(txn, channel, &mut ws.missing_context, n.inode, change_id, e)
.map_err(LocalApplyError::from_missing)?