diff --git a/rust/hg-core/src/copy_tracing.rs b/rust/hg-core/src/copy_tracing.rs index bd86cad566056f2a7801556417f01526fc8713a6_cnVzdC9oZy1jb3JlL3NyYy9jb3B5X3RyYWNpbmcucnM=..d609f3c22159d2374c31088f0e0fbfed435c7110_cnVzdC9oZy1jb3JlL3NyYy9jb3B5X3RyYWNpbmcucnM= 100644 --- a/rust/hg-core/src/copy_tracing.rs +++ b/rust/hg-core/src/copy_tracing.rs @@ -12,9 +12,11 @@ pub type PathCopies = HashMap<HgPathBuf, HgPathBuf>; +type PathToken = HgPathBuf; + #[derive(Clone, Debug, PartialEq)] struct TimeStampedPathCopy { /// revision at which the copy information was added rev: Revision, /// the copy source, (Set to None in case of deletion of the associated /// key) @@ -15,10 +17,10 @@ #[derive(Clone, Debug, PartialEq)] struct TimeStampedPathCopy { /// revision at which the copy information was added rev: Revision, /// the copy source, (Set to None in case of deletion of the associated /// key) - path: Option<HgPathBuf>, + path: Option<PathToken>, } /// maps CopyDestination to Copy Source (+ a "timestamp" for the operation) @@ -22,7 +24,7 @@ } /// maps CopyDestination to Copy Source (+ a "timestamp" for the operation) -type TimeStampedPathCopies = OrdMap<HgPathBuf, TimeStampedPathCopy>; +type TimeStampedPathCopies = OrdMap<PathToken, TimeStampedPathCopy>; /// hold parent 1, parent 2 and relevant files actions. pub type RevInfo<'a> = (Revision, Revision, ChangedFiles<'a>); @@ -500,7 +502,7 @@ // actively working on this code. Feel free to re-inline it once this // code is more settled. let mut cmp_value = - |dest: &HgPathBuf, + |dest: &PathToken, src_minor: &TimeStampedPathCopy, src_major: &TimeStampedPathCopy| { compare_value(changes, oracle, dest, src_minor, src_major) @@ -558,6 +560,6 @@ let mut override_minor = Vec::new(); let mut override_major = Vec::new(); - let mut to_major = |k: &HgPathBuf, v: &TimeStampedPathCopy| { + let mut to_major = |k: &PathToken, v: &TimeStampedPathCopy| { override_major.push((k.clone(), v.clone())) }; @@ -562,6 +564,6 @@ override_major.push((k.clone(), v.clone())) }; - let mut to_minor = |k: &HgPathBuf, v: &TimeStampedPathCopy| { + let mut to_minor = |k: &PathToken, v: &TimeStampedPathCopy| { override_minor.push((k.clone(), v.clone())) }; @@ -635,7 +637,7 @@ fn compare_value<A: Fn(Revision, Revision) -> bool>( changes: &ChangedFiles, oracle: &mut AncestorOracle<A>, - dest: &HgPathBuf, + dest: &PathToken, src_minor: &TimeStampedPathCopy, src_major: &TimeStampedPathCopy, ) -> MergePick {