RSFUX6MLPHII3DRELHN62DOJCHFCDNKSRMWJDSFGTWN5S4RJVSSQC FJTRJD6BWXK5TMCYHXLTXVCM2ZOC4BN6Q5K72LAFITRK36RDYNDAC 3I4PAA2AW3VUTA3HLS2G4TQMWB7BO25DMCC7VWJHG6WMHCBHR6JAC KNB3RZMS4VRNBXGLSA6P6IDSCIKYRNLNCQ5RDMREUO4NVECKWURAC FABI77LLTZYJAH4YMQ4Y6LXGTHPQ52FSA4DNZ5HHYRU2PXY5WDIAC I24UEJQLCH2SOXA4UHIYWTRDCHSOPU7AFTRUOTX7HZIAV4AZKYEQC 7NSTS6PKVQWNUGIUYBRS4GWHJPAV57TOPBTDCOBZ5YYQNFZIZW2QC SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC 6YMDOZIB5LVYLFIDGN2WNT5JTHEAMS4TFPVDEZ3OWXWOKJOC5QDAC CCLLB7OIFNFYJZTG3UCI7536TOCWSCSXR67VELSB466R24WLJSDAC MDADYULS5AWVMTJDGYCGNQTN6T7XJDRUBDTFILDY5MLF6I2PE5NAC VO5OQW4W2656DIYYRNZ3PO7TQ4JOKQ3GVWE5ALUTYVMX3WMXJOYQC AD6M434OFUCH6ISHP7GXSNNRBHEWP242ZDH7QCVCYLHMRASGE5MQC YN63NUZO4LVJ7XPMURDULTXBVJKW5MVCTZ24R7Z52QMHO3HPDUVQC RRCSHAYZ6RLWVPNYHF2F5FSRL2KKJNPQUQRIJYLJGB23BZQQ7JLQC SFQBWL6PHSX7MQVOSQW4ZO35SLXNHN6562IWYCN4UKWAEVE6AQNQC T7CAACFBDKOZEBM7XBX7HMCDM66RWEYKLOJY6JNIGWOFKV2HQEBQC let mut alive = alive.borrow().clone();debug!("files = {:?}", ws.files);crate::TIMERS.lock().unwrap().find_alive += now.elapsed();ws.load_graph(txn, channel, inode)?;
if let Some(alive) = alive {let mut alive = alive.clone();debug!("files = {:?}", ws.files);crate::TIMERS.lock().unwrap().find_alive += now.elapsed();ws.load_graph(txn, channel, inode)?;
debug!("repair_missing_up_context, alive = {:?}", alive);for &d in d {if let Some((graph, vids)) = ws.graphs.0.get(&inode) {crate::alive::remove_redundant_parents(graph,vids,&mut alive,&mut ws.covered_parents,d,);
debug!("repair_missing_up_context, alive = {:?}", alive);for &d in d {if let Some((graph, vids)) = ws.graphs.0.get(&inode) {crate::alive::remove_redundant_parents(graph,vids,&mut alive,&mut ws.covered_parents,d,);}repair_regular_up(txn, channel, &alive, d, EdgeFlags::PSEUDO)?;
let mut alive = alive.borrow().clone();debug!("alive = {:?}", alive);crate::TIMERS.lock().unwrap().find_alive += now.elapsed();ws.load_graph(txn, channel, inode)?;if let Some((graph, vids)) = ws.graphs.0.get(&inode) {crate::alive::remove_redundant_children(graph, vids, &mut alive, c);}
if let Some(alive) = alive {let mut alive = alive.clone();debug!("alive = {:?}", alive);crate::TIMERS.lock().unwrap().find_alive += now.elapsed();ws.load_graph(txn, channel, inode)?;if let Some((graph, vids)) = ws.graphs.0.get(&inode) {crate::alive::remove_redundant_children(graph, vids, &mut alive, c);}
for &d in d {for &desc in alive.iter() {if d == desc {info!("repair_missing_down_context, alive: {:?} == {:?}", d, desc);continue;
for &d in d {for &desc in alive.iter() {if d == desc {info!("repair_missing_down_context, alive: {:?} == {:?}", d, desc);continue;}debug!("repair_missing_down {:?} {:?}", d, desc);put_graph_with_rev(txn, channel, EdgeFlags::PSEUDO, d, desc, ChangeId::ROOT)?;
alive_down_cache: HashMap<Vertex<ChangeId>, Rc<RefCell<HashSet<Vertex<ChangeId>>>>>,alive_up_cache: HashMap<Vertex<ChangeId>,(Rc<RefCell<HashSet<Vertex<ChangeId>>>>,Rc<RefCell<HashSet<Vertex<ChangeId>>>>,),>,
alive_down_cache: HashMap<Vertex<ChangeId>, Option<HashSet<Vertex<ChangeId>>>>,alive_up_cache:HashMap<Vertex<ChangeId>, (Option<HashSet<Vertex<ChangeId>>>, HashSet<Vertex<ChangeId>>)>,
pub(crate) fn find_alive_down<T: GraphTxnT>(
/// The following is an unrolled DFS, where each alive vertex is/// inserted into each "alive set" along the current path (which is/// recognised by looking at the visited vertices on the stack).pub(crate) fn find_alive_down<'a, T: GraphTxnT>(
cache: &mut HashMap<Vertex<ChangeId>, Alive>,) -> Result<Alive, BlockError<T::GraphError>> {let mut stack = vec![SerializedEdge::empty(vertex0.start_pos(), ChangeId::ROOT)];
cache: &'a mut HashMap<Vertex<ChangeId>, Option<HashSet<Vertex<ChangeId>>>>,) -> Result<&'a Option<HashSet<Vertex<ChangeId>>>, BlockError<T::GraphError>> {let mut stack: Vec<(_, Option<HashSet<Vertex<ChangeId>>>)> = vec![(SerializedEdge::empty(vertex0.start_pos(), ChangeId::ROOT),None,)];
let alive = Rc::new(RefCell::new(HashSet::new()));while let Some(elt) = stack.pop() {if !visited.insert(elt.dest()) {
while let Some((elt, alive)) = stack.pop() {if let Some(alive) = alive {// We've gone through all the descendants, put this in the// cache.let vertex = txn.find_block(&channel, elt.dest())?;cache.insert(*vertex, Some(alive.clone()));if stack.is_empty() {// Done!return Ok(cache.get(&vertex0).unwrap());}
assert!(alive.borrow().is_empty());return Ok(alive);
// vertex0 is alive.stack.truncate(elt_index);let (_, alive) = stack.pop().unwrap();let alive = alive.unwrap();assert!(alive.is_empty());cache.insert(vertex0, None);return Ok(cache.get(&vertex0).unwrap());
cache: &mut HashMap<Vertex<ChangeId>, (Alive, Alive)>,) -> Result<Alive, BlockError<T::GraphError>> {
cache: &'a mut HashMap<Vertex<ChangeId>,(Option<HashSet<Vertex<ChangeId>>>, HashSet<Vertex<ChangeId>>),>,) -> Result<&'a Option<HashSet<Vertex<ChangeId>>>, BlockError<T::GraphError>> {
let alive = Rc::new(RefCell::new(HashSet::default()));let files_ = Rc::new(RefCell::new(HashSet::default()));let mut stack = vec![SerializedEdge::empty(vertex0.end_pos(), ChangeId::ROOT)];
let mut stack: Vec<(_,Option<(HashSet<Vertex<ChangeId>>, HashSet<Vertex<ChangeId>>)>,)> = vec![(SerializedEdge::empty(vertex0.end_pos(), ChangeId::ROOT),None,)];
if !visited.insert(elt.dest()) {
if let Some((alive, files_)) = alive {let vertex = *txn.find_block_end(&channel, elt.dest())?;cache.insert(vertex, (Some(alive), files_));if stack.is_empty() {// Done!return Ok(&cache.get(&vertex0).unwrap().0);}
let is_cached = if let Some((c, f)) = cache.get(&vertex) {alive.borrow_mut().extend(c.borrow().iter().cloned());files_.borrow_mut().extend(f.borrow().iter().cloned());files.extend(f.borrow().iter().cloned());// We're not continuing here, since the while loop below// needs to insert stuff into `files` and `files_`.true} else {cache.insert(vertex, (alive.clone(), files_.clone()));false};
if let Some((c, d)) = cache.get(&vertex) {debug!("Cached: {:?} {:?}", c, d);for st in stack.iter_mut() {if let Some((ref mut al, ref mut f)) = st.1 {if let Some(c) = c {al.extend(c.iter().cloned());} else {al.insert(vertex);}f.extend(d.iter().cloned());files.extend(d.iter().cloned());}}continue;}
if is_file && vertex != vertex0 {debug!("is alive {:?}", vertex);alive.borrow_mut().insert(vertex);files_.borrow_mut().insert(vertex);
if is_file {debug!("is pseudo-alive folder {:?}", vertex);for st in stack.iter_mut() {if let Some((ref mut al, ref mut fi)) = st.1 {al.insert(vertex);fi.insert(vertex);}}