##// END OF EJS Templates
copies-rust: make more use of the new comparison property...
marmoute -
r47325:8fcf07e6 default
parent child Browse files
Show More
@@ -847,49 +847,31 b' fn compare_value('
847 src_minor: &CopySource,
847 src_minor: &CopySource,
848 src_major: &CopySource,
848 src_major: &CopySource,
849 ) -> (MergePick, bool) {
849 ) -> (MergePick, bool) {
850 if src_major.rev == current_merge {
850 if src_major == src_minor {
851 if src_minor.rev == current_merge {
851 (MergePick::Any, false)
852 if src_major.path.is_none() {
852 } else if src_major.rev == current_merge {
853 // We cannot get different copy information for both p1 and p2
853 // minor is different according to per minor == major check earlier
854 // from the same revision. Unless this was a
854 debug_assert!(src_minor.rev != current_merge);
855 // deletion.
855
856 //
857 // However the deletion might come over different data on each
858 // branch.
859 let need_over = src_major.overwritten != src_minor.overwritten;
860 (MergePick::Any, need_over)
861 } else {
862 unreachable!();
863 }
864 } else {
865 // The last value comes the current merge, this value -will- win
856 // The last value comes the current merge, this value -will- win
866 // eventually.
857 // eventually.
867 (MergePick::Major, true)
858 (MergePick::Major, true)
868 }
869 } else if src_minor.rev == current_merge {
859 } else if src_minor.rev == current_merge {
870 // The last value comes the current merge, this value -will- win
860 // The last value comes the current merge, this value -will- win
871 // eventually.
861 // eventually.
872 (MergePick::Minor, true)
862 (MergePick::Minor, true)
873 } else if src_major.path == src_minor.path {
863 } else if src_major.path == src_minor.path {
864 debug_assert!(src_major.rev != src_major.rev);
874 // we have the same value, but from other source;
865 // we have the same value, but from other source;
875 if src_major.rev == src_minor.rev {
866 if src_major.is_overwritten_by(src_minor) {
876 // If the two entry are identical, they are both valid
877 debug_assert!(src_minor.overwritten == src_minor.overwritten);
878 (MergePick::Any, false)
879 } else if src_major.is_overwritten_by(src_minor) {
880 (MergePick::Minor, false)
867 (MergePick::Minor, false)
881 } else if src_minor.is_overwritten_by(src_major) {
868 } else if src_minor.is_overwritten_by(src_major) {
882 (MergePick::Major, false)
869 (MergePick::Major, false)
883 } else {
870 } else {
884 (MergePick::Any, true)
871 (MergePick::Any, true)
885 }
872 }
886 } else if src_major.rev == src_minor.rev {
887 // We cannot get copy information for both p1 and p2 in the
888 // same rev. So this is the same value.
889 unreachable!(
890 "conflicting information from p1 and p2 in the same revision"
891 );
892 } else {
873 } else {
874 debug_assert!(src_major.rev != src_major.rev);
893 let dest_path = path_map.untokenize(*dest);
875 let dest_path = path_map.untokenize(*dest);
894 let action = changes.get_merge_case(dest_path);
876 let action = changes.get_merge_case(dest_path);
895 if src_minor.path.is_some()
877 if src_minor.path.is_some()
General Comments 0
You need to be logged in to leave comments. Login now