##// END OF EJS Templates
copies-rust: get the parents' copies earlier...
marmoute -
r47317:389b0328 default
parent child Browse files
Show More
@@ -397,59 +397,60 b' pub fn combine_changeset_copies<D>('
397 // the individual copies information the curent revision. Creating a
397 // the individual copies information the curent revision. Creating a
398 // new TimeStampedPath for each `rev` → `children` vertex.
398 // new TimeStampedPath for each `rev` → `children` vertex.
399 let mut copies: Option<InternalPathCopies> = None;
399 let mut copies: Option<InternalPathCopies> = None;
400 if p1 != NULL_REVISION {
400 // Retrieve data computed in a previous iteration
401 // Retrieve data computed in a previous iteration
401 let p1_copies = match p1 {
402 let parent_copies = get_and_clean_parent_copies(
402 NULL_REVISION => None,
403 _ => get_and_clean_parent_copies(
403 &mut all_copies,
404 &mut all_copies,
404 &mut children_count,
405 &mut children_count,
405 p1,
406 p1,
406 );
407 ), // will be None if the vertex is not to be traversed
407 if let Some(parent_copies) = parent_copies {
408 };
408 // combine it with data for that revision
409 let p2_copies = match p2 {
409 let vertex_copies = add_from_changes(
410 NULL_REVISION => None,
410 &mut path_map,
411 _ => get_and_clean_parent_copies(
411 &parent_copies,
412 &changes,
413 Parent::FirstParent,
414 rev,
415 );
416 // keep that data around for potential later combination
417 copies = Some(vertex_copies);
418 }
419 }
420 if p2 != NULL_REVISION {
421 // Retrieve data computed in a previous iteration
422 let parent_copies = get_and_clean_parent_copies(
423 &mut all_copies,
412 &mut all_copies,
424 &mut children_count,
413 &mut children_count,
425 p2,
414 p2,
415 ), // will be None if the vertex is not to be traversed
416 };
417 if let Some(parent_copies) = p1_copies {
418 // combine it with data for that revision
419 let vertex_copies = add_from_changes(
420 &mut path_map,
421 &parent_copies,
422 &changes,
423 Parent::FirstParent,
424 rev,
426 );
425 );
427 if let Some(parent_copies) = parent_copies {
426 // keep that data around for potential later combination
428 // combine it with data for that revision
427 copies = Some(vertex_copies);
429 let vertex_copies = add_from_changes(
428 }
430 &mut path_map,
429 if let Some(parent_copies) = p2_copies {
431 &parent_copies,
430 // combine it with data for that revision
432 &changes,
431 let vertex_copies = add_from_changes(
433 Parent::SecondParent,
432 &mut path_map,
434 rev,
433 &parent_copies,
435 );
434 &changes,
435 Parent::SecondParent,
436 rev,
437 );
436
438
437 copies = match copies {
439 copies = match copies {
438 None => Some(vertex_copies),
440 None => Some(vertex_copies),
439 // Merge has two parents needs to combines their copy
441 // Merge has two parents needs to combines their copy
440 // information.
442 // information.
441 //
443 //
442 // If we got data from both parents, We need to combine
444 // If we got data from both parents, We need to combine
443 // them.
445 // them.
444 Some(copies) => Some(merge_copies_dict(
446 Some(copies) => Some(merge_copies_dict(
445 &path_map,
447 &path_map,
446 rev,
448 rev,
447 vertex_copies,
449 vertex_copies,
448 copies,
450 copies,
449 &changes,
451 &changes,
450 )),
452 )),
451 };
453 };
452 }
453 }
454 }
454 match copies {
455 match copies {
455 Some(copies) => {
456 Some(copies) => {
General Comments 0
You need to be logged in to leave comments. Login now