##// END OF EJS Templates
copies-rust: make the comparison aware of the revision being current merged...
marmoute -
r46771:7d99614b default
parent child Browse files
Show More
@@ -431,6 +431,7 b' pub fn combine_changeset_copies<A: Fn(Re'
431 431 // them.
432 432 Some(copies) => Some(merge_copies_dict(
433 433 &path_map,
434 rev,
434 435 vertex_copies,
435 436 copies,
436 437 &changes,
@@ -558,6 +559,7 b' fn add_from_changes<A: Fn(Revision, Revi'
558 559 /// cases. See inline documentation for details.
559 560 fn merge_copies_dict<A: Fn(Revision, Revision) -> bool>(
560 561 path_map: &TwoWayPathMap,
562 current_merge: Revision,
561 563 mut minor: TimeStampedPathCopies,
562 564 mut major: TimeStampedPathCopies,
563 565 changes: &ChangedFiles,
@@ -571,7 +573,13 b' fn merge_copies_dict<A: Fn(Revision, Rev'
571 573 src_minor: &TimeStampedPathCopy,
572 574 src_major: &TimeStampedPathCopy| {
573 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 585 if minor.is_empty() {
@@ -703,13 +711,33 b' enum MergePick {'
703 711 #[allow(clippy::if_same_then_else)]
704 712 fn compare_value<A: Fn(Revision, Revision) -> bool>(
705 713 path_map: &TwoWayPathMap,
714 current_merge: Revision,
706 715 changes: &ChangedFiles,
707 716 oracle: &mut AncestorOracle<A>,
708 717 dest: &PathToken,
709 718 src_minor: &TimeStampedPathCopy,
710 719 src_major: &TimeStampedPathCopy,
711 720 ) -> MergePick {
712 if src_major.path == src_minor.path {
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 741 // we have the same value, but from other source;
714 742 if src_major.rev == src_minor.rev {
715 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