##// END OF EJS Templates
rust-ancestors: adjust branches and inline comments per previous change...
Yuya Nishihara -
r41170:17a19567 default
parent child Browse files
Show More
@@ -336,17 +336,15 b' impl<G: Graph> MissingAncestors<G> {'
336 bases_visit.insert(p);
336 bases_visit.insert(p);
337 both_visit.insert(p);
337 both_visit.insert(p);
338 }
338 }
339 continue;
339 } else if revs_visit.remove(&curr) {
340 }
341 if revs_visit.remove(&curr) {
342 missing.push(curr);
340 missing.push(curr);
343 for p in self.graph.parents(curr)?.iter().cloned() {
341 for p in self.graph.parents(curr)?.iter().cloned() {
344 if p == NULL_REVISION {
342 if p == NULL_REVISION {
345 continue;
343 continue;
346 }
344 }
347 if bases_visit.contains(&p) || both_visit.contains(&p) {
345 if bases_visit.contains(&p) || both_visit.contains(&p) {
348 // p is implicitely in this_visit.
346 // p is an ancestor of revs_visit, and is implicitly
349 // This means p is or should be in bothvisit
347 // in bases_visit, which means p is ::revs & ::bases.
350 // TODO optim: hence if bothvisit, we look up twice
348 // TODO optim: hence if bothvisit, we look up twice
351 revs_visit.remove(&p);
349 revs_visit.remove(&p);
352 bases_visit.insert(p);
350 bases_visit.insert(p);
@@ -362,19 +360,16 b' impl<G: Graph> MissingAncestors<G> {'
362 continue;
360 continue;
363 }
361 }
364 if revs_visit.contains(&p) || both_visit.contains(&p) {
362 if revs_visit.contains(&p) || both_visit.contains(&p) {
365 // p is implicitely in this_visit.
363 // p is an ancestor of bases_visit, and is implicitly
366 // This means p is or should be in bothvisit
364 // in revs_visit, which means p is ::revs & ::bases.
367 // TODO optim: hence if bothvisit, we look up twice
365 // TODO optim: hence if bothvisit, we look up twice
368 revs_visit.remove(&p);
366 revs_visit.remove(&p);
369 bases_visit.insert(p);
367 bases_visit.insert(p);
370 both_visit.insert(p);
368 both_visit.insert(p);
371 } else {
369 } else {
372 // visit later
373 bases_visit.insert(p);
370 bases_visit.insert(p);
374 }
371 }
375 }
372 }
376 } else {
377 // not an ancestor of revs or bases: ignore
378 }
373 }
379 }
374 }
380 missing.reverse();
375 missing.reverse();
General Comments 0
You need to be logged in to leave comments. Login now