##// END OF EJS Templates
copies-rust: rename TimeStampedPathCopy to CopySource...
marmoute -
r47312:2bd06978 default
parent child Browse files
Show More
@@ -16,7 +16,7 b' pub type PathCopies = HashMap<HgPathBuf,'
16 type PathToken = usize;
16 type PathToken = usize;
17
17
18 #[derive(Clone, Debug, PartialEq, Copy)]
18 #[derive(Clone, Debug, PartialEq, Copy)]
19 struct TimeStampedPathCopy {
19 struct CopySource {
20 /// revision at which the copy information was added
20 /// revision at which the copy information was added
21 rev: Revision,
21 rev: Revision,
22 /// the copy source, (Set to None in case of deletion of the associated
22 /// the copy source, (Set to None in case of deletion of the associated
@@ -25,7 +25,7 b' struct TimeStampedPathCopy {'
25 }
25 }
26
26
27 /// maps CopyDestination to Copy Source (+ a "timestamp" for the operation)
27 /// maps CopyDestination to Copy Source (+ a "timestamp" for the operation)
28 type InternalPathCopies = OrdMap<PathToken, TimeStampedPathCopy>;
28 type InternalPathCopies = OrdMap<PathToken, CopySource>;
29
29
30 /// hold parent 1, parent 2 and relevant files actions.
30 /// hold parent 1, parent 2 and relevant files actions.
31 pub type RevInfo<'a> = (Revision, Revision, ChangedFiles<'a>);
31 pub type RevInfo<'a> = (Revision, Revision, ChangedFiles<'a>);
@@ -521,7 +521,7 b' fn add_from_changes<A: Fn(Revision, Revi'
521 // information. See merge_copies_dict for details.
521 // information. See merge_copies_dict for details.
522 match copies.entry(dest) {
522 match copies.entry(dest) {
523 Entry::Vacant(slot) => {
523 Entry::Vacant(slot) => {
524 let ttpc = TimeStampedPathCopy {
524 let ttpc = CopySource {
525 rev: current_rev,
525 rev: current_rev,
526 path: entry,
526 path: entry,
527 };
527 };
@@ -570,8 +570,8 b' fn merge_copies_dict<A: Fn(Revision, Rev'
570 // code is more settled.
570 // code is more settled.
571 let cmp_value = |oracle: &mut AncestorOracle<A>,
571 let cmp_value = |oracle: &mut AncestorOracle<A>,
572 dest: &PathToken,
572 dest: &PathToken,
573 src_minor: &TimeStampedPathCopy,
573 src_minor: &CopySource,
574 src_major: &TimeStampedPathCopy| {
574 src_major: &CopySource| {
575 compare_value(
575 compare_value(
576 path_map,
576 path_map,
577 current_merge,
577 current_merge,
@@ -619,7 +619,7 b' fn merge_copies_dict<A: Fn(Revision, Rev'
619 MergePick::Minor => src_minor.path,
619 MergePick::Minor => src_minor.path,
620 MergePick::Any => src_major.path,
620 MergePick::Any => src_major.path,
621 };
621 };
622 let src = TimeStampedPathCopy {
622 let src = CopySource {
623 rev: current_merge,
623 rev: current_merge,
624 path,
624 path,
625 };
625 };
@@ -654,7 +654,7 b' fn merge_copies_dict<A: Fn(Revision, Rev'
654 MergePick::Minor => src_major.path,
654 MergePick::Minor => src_major.path,
655 MergePick::Any => src_major.path,
655 MergePick::Any => src_major.path,
656 };
656 };
657 let src = TimeStampedPathCopy {
657 let src = CopySource {
658 rev: current_merge,
658 rev: current_merge,
659 path,
659 path,
660 };
660 };
@@ -673,10 +673,10 b' fn merge_copies_dict<A: Fn(Revision, Rev'
673 let mut override_minor = Vec::new();
673 let mut override_minor = Vec::new();
674 let mut override_major = Vec::new();
674 let mut override_major = Vec::new();
675
675
676 let mut to_major = |k: &PathToken, v: &TimeStampedPathCopy| {
676 let mut to_major = |k: &PathToken, v: &CopySource| {
677 override_major.push((k.clone(), v.clone()))
677 override_major.push((k.clone(), v.clone()))
678 };
678 };
679 let mut to_minor = |k: &PathToken, v: &TimeStampedPathCopy| {
679 let mut to_minor = |k: &PathToken, v: &CopySource| {
680 override_minor.push((k.clone(), v.clone()))
680 override_minor.push((k.clone(), v.clone()))
681 };
681 };
682
682
@@ -713,7 +713,7 b' fn merge_copies_dict<A: Fn(Revision, Rev'
713 // anything (but diff should not have yield them)
713 // anything (but diff should not have yield them)
714 MergePick::Any => src_major.path,
714 MergePick::Any => src_major.path,
715 };
715 };
716 let src = TimeStampedPathCopy {
716 let src = CopySource {
717 rev: current_merge,
717 rev: current_merge,
718 path,
718 path,
719 };
719 };
@@ -773,8 +773,8 b' fn compare_value<A: Fn(Revision, Revisio'
773 changes: &ChangedFiles,
773 changes: &ChangedFiles,
774 oracle: &mut AncestorOracle<A>,
774 oracle: &mut AncestorOracle<A>,
775 dest: &PathToken,
775 dest: &PathToken,
776 src_minor: &TimeStampedPathCopy,
776 src_minor: &CopySource,
777 src_major: &TimeStampedPathCopy,
777 src_major: &CopySource,
778 ) -> (MergePick, bool) {
778 ) -> (MergePick, bool) {
779 if src_major.rev == current_merge {
779 if src_major.rev == current_merge {
780 if src_minor.rev == current_merge {
780 if src_minor.rev == current_merge {
General Comments 0
You need to be logged in to leave comments. Login now