##// END OF EJS Templates
copies-rust: use matching to select the final copies information...
marmoute -
r47318:f8bdc832 default
parent child Browse files
Show More
@@ -414,49 +414,37 b' pub fn combine_changeset_copies<D>('
414 p2,
414 p2,
415 ), // will be None if the vertex is not to be traversed
415 ), // will be None if the vertex is not to be traversed
416 };
416 };
417 if let Some(parent_copies) = p1_copies {
417 // combine it with data for that revision
418 // combine it with data for that revision
418 let p1_copies = match p1_copies {
419 let vertex_copies = add_from_changes(
419 None => None,
420 Some(parent_copies) => Some(add_from_changes(
420 &mut path_map,
421 &mut path_map,
421 &parent_copies,
422 &parent_copies,
422 &changes,
423 &changes,
423 Parent::FirstParent,
424 Parent::FirstParent,
424 rev,
425 rev,
425 );
426 )),
426 // keep that data around for potential later combination
427 };
427 copies = Some(vertex_copies);
428 let p2_copies = match p2_copies {
428 }
429 None => None,
429 if let Some(parent_copies) = p2_copies {
430 Some(parent_copies) => Some(add_from_changes(
430 // combine it with data for that revision
431 let vertex_copies = add_from_changes(
432 &mut path_map,
431 &mut path_map,
433 &parent_copies,
432 &parent_copies,
434 &changes,
433 &changes,
435 Parent::SecondParent,
434 Parent::SecondParent,
436 rev,
435 rev,
437 );
436 )),
438
437 };
439 copies = match copies {
438 let copies = match (p1_copies, p2_copies) {
440 None => Some(vertex_copies),
439 (None, None) => None,
441 // Merge has two parents needs to combines their copy
440 (c, None) => c,
442 // information.
441 (None, c) => c,
443 //
442 (Some(p1_copies), Some(p2_copies)) => Some(merge_copies_dict(
444 // If we got data from both parents, We need to combine
443 &path_map, rev, p2_copies, p1_copies, &changes,
445 // them.
444 )),
446 Some(copies) => Some(merge_copies_dict(
445 };
447 &path_map,
446 if let Some(c) = copies {
448 rev,
447 all_copies.insert(rev, c);
449 vertex_copies,
450 copies,
451 &changes,
452 )),
453 };
454 }
455 match copies {
456 Some(copies) => {
457 all_copies.insert(rev, copies);
458 }
459 _ => {}
460 }
448 }
461 }
449 }
462
450
General Comments 0
You need to be logged in to leave comments. Login now