}
Ok(())
}
fn reconnect_target_down<T: GraphMutTxnT, K>(
txn: &mut T,
channel: &mut T::Graph,
ws: &mut Workspace,
inode: Position<Option<Hash>>,
target: Vertex<ChangeId>,
change_id: ChangeId,
known: &mut K,
) -> Result<(), MissingError<T::GraphError>>
where
K: FnMut(Hash) -> bool,
{
// Finally, we fix the down context of target, i.e. collecting unknown deleted children.
let mut children_are_deleted_by_unknown = false;
for v in iter_adj_all(txn, channel, target)? {
let v = v?;
if !v.flag.contains(EdgeFlags::DELETED)
|| v.flag.contains(EdgeFlags::PARENT)
|| v.introduced_by == change_id
|| v.dest.change.is_root()
|| v.introduced_by.is_root()
{
continue;
}
// This unwrap is ok, since `v` is in the channel.
let intro = txn.get_external(v.introduced_by)?.unwrap();
if !known(intro) {
children_are_deleted_by_unknown = true;
break;
}