Show More
@@ -431,6 +431,7 b' pub fn combine_changeset_copies<A: Fn(Re' | |||||
431 | // them. |
|
431 | // them. | |
432 | Some(copies) => Some(merge_copies_dict( |
|
432 | Some(copies) => Some(merge_copies_dict( | |
433 | &path_map, |
|
433 | &path_map, | |
|
434 | rev, | |||
434 | vertex_copies, |
|
435 | vertex_copies, | |
435 | copies, |
|
436 | copies, | |
436 | &changes, |
|
437 | &changes, | |
@@ -558,6 +559,7 b' fn add_from_changes<A: Fn(Revision, Revi' | |||||
558 | /// cases. See inline documentation for details. |
|
559 | /// cases. See inline documentation for details. | |
559 | fn merge_copies_dict<A: Fn(Revision, Revision) -> bool>( |
|
560 | fn merge_copies_dict<A: Fn(Revision, Revision) -> bool>( | |
560 | path_map: &TwoWayPathMap, |
|
561 | path_map: &TwoWayPathMap, | |
|
562 | current_merge: Revision, | |||
561 | mut minor: TimeStampedPathCopies, |
|
563 | mut minor: TimeStampedPathCopies, | |
562 | mut major: TimeStampedPathCopies, |
|
564 | mut major: TimeStampedPathCopies, | |
563 | changes: &ChangedFiles, |
|
565 | changes: &ChangedFiles, | |
@@ -571,7 +573,13 b' fn merge_copies_dict<A: Fn(Revision, Rev' | |||||
571 | src_minor: &TimeStampedPathCopy, |
|
573 | src_minor: &TimeStampedPathCopy, | |
572 | src_major: &TimeStampedPathCopy| { |
|
574 | src_major: &TimeStampedPathCopy| { | |
573 | compare_value( |
|
575 | compare_value( | |
574 | path_map, changes, oracle, dest, src_minor, src_major, |
|
576 | path_map, | |
|
577 | current_merge, | |||
|
578 | changes, | |||
|
579 | oracle, | |||
|
580 | dest, | |||
|
581 | src_minor, | |||
|
582 | src_major, | |||
575 | ) |
|
583 | ) | |
576 | }; |
|
584 | }; | |
577 | if minor.is_empty() { |
|
585 | if minor.is_empty() { | |
@@ -703,13 +711,33 b' enum MergePick {' | |||||
703 | #[allow(clippy::if_same_then_else)] |
|
711 | #[allow(clippy::if_same_then_else)] | |
704 | fn compare_value<A: Fn(Revision, Revision) -> bool>( |
|
712 | fn compare_value<A: Fn(Revision, Revision) -> bool>( | |
705 | path_map: &TwoWayPathMap, |
|
713 | path_map: &TwoWayPathMap, | |
|
714 | current_merge: Revision, | |||
706 | changes: &ChangedFiles, |
|
715 | changes: &ChangedFiles, | |
707 | oracle: &mut AncestorOracle<A>, |
|
716 | oracle: &mut AncestorOracle<A>, | |
708 | dest: &PathToken, |
|
717 | dest: &PathToken, | |
709 | src_minor: &TimeStampedPathCopy, |
|
718 | src_minor: &TimeStampedPathCopy, | |
710 | src_major: &TimeStampedPathCopy, |
|
719 | src_major: &TimeStampedPathCopy, | |
711 | ) -> MergePick { |
|
720 | ) -> MergePick { | |
712 |
if src_major. |
|
721 | if src_major.rev == current_merge { | |
|
722 | if src_minor.rev == current_merge { | |||
|
723 | if src_major.path.is_none() { | |||
|
724 | // We cannot get different copy information for both p1 and p2 | |||
|
725 | // from the same revision. Unless this was a | |||
|
726 | // deletion | |||
|
727 | MergePick::Any | |||
|
728 | } else { | |||
|
729 | unreachable!(); | |||
|
730 | } | |||
|
731 | } else { | |||
|
732 | // The last value comes the current merge, this value -will- win | |||
|
733 | // eventually. | |||
|
734 | MergePick::Major | |||
|
735 | } | |||
|
736 | } else if src_minor.rev == current_merge { | |||
|
737 | // The last value comes the current merge, this value -will- win | |||
|
738 | // eventually. | |||
|
739 | MergePick::Minor | |||
|
740 | } else if src_major.path == src_minor.path { | |||
713 | // we have the same value, but from other source; |
|
741 | // we have the same value, but from other source; | |
714 | if src_major.rev == src_minor.rev { |
|
742 | if src_major.rev == src_minor.rev { | |
715 | // If the two entry are identical, they are both valid |
|
743 | // If the two entry are identical, they are both valid |
General Comments 0
You need to be logged in to leave comments.
Login now