##// END OF EJS Templates
copies-rust: pre-introduce a PathToken type and use it where applicable...
marmoute -
r46745:818502d2 default
parent child Browse files
Show More
@@ -11,17 +11,19 b' use std::convert::TryInto;'
11 11
12 12 pub type PathCopies = HashMap<HgPathBuf, HgPathBuf>;
13 13
14 type PathToken = HgPathBuf;
15
14 16 #[derive(Clone, Debug, PartialEq)]
15 17 struct TimeStampedPathCopy {
16 18 /// revision at which the copy information was added
17 19 rev: Revision,
18 20 /// the copy source, (Set to None in case of deletion of the associated
19 21 /// key)
20 path: Option<HgPathBuf>,
22 path: Option<PathToken>,
21 23 }
22 24
23 25 /// maps CopyDestination to Copy Source (+ a "timestamp" for the operation)
24 type TimeStampedPathCopies = OrdMap<HgPathBuf, TimeStampedPathCopy>;
26 type TimeStampedPathCopies = OrdMap<PathToken, TimeStampedPathCopy>;
25 27
26 28 /// hold parent 1, parent 2 and relevant files actions.
27 29 pub type RevInfo<'a> = (Revision, Revision, ChangedFiles<'a>);
@@ -467,7 +469,7 b' fn merge_copies_dict<A: Fn(Revision, Rev'
467 469 // actively working on this code. Feel free to re-inline it once this
468 470 // code is more settled.
469 471 let mut cmp_value =
470 |dest: &HgPathBuf,
472 |dest: &PathToken,
471 473 src_minor: &TimeStampedPathCopy,
472 474 src_major: &TimeStampedPathCopy| {
473 475 compare_value(changes, oracle, dest, src_minor, src_major)
@@ -525,10 +527,10 b' fn merge_copies_dict<A: Fn(Revision, Rev'
525 527 let mut override_minor = Vec::new();
526 528 let mut override_major = Vec::new();
527 529
528 let mut to_major = |k: &HgPathBuf, v: &TimeStampedPathCopy| {
530 let mut to_major = |k: &PathToken, v: &TimeStampedPathCopy| {
529 531 override_major.push((k.clone(), v.clone()))
530 532 };
531 let mut to_minor = |k: &HgPathBuf, v: &TimeStampedPathCopy| {
533 let mut to_minor = |k: &PathToken, v: &TimeStampedPathCopy| {
532 534 override_minor.push((k.clone(), v.clone()))
533 535 };
534 536
@@ -602,7 +604,7 b' enum MergePick {'
602 604 fn compare_value<A: Fn(Revision, Revision) -> bool>(
603 605 changes: &ChangedFiles,
604 606 oracle: &mut AncestorOracle<A>,
605 dest: &HgPathBuf,
607 dest: &PathToken,
606 608 src_minor: &TimeStampedPathCopy,
607 609 src_major: &TimeStampedPathCopy,
608 610 ) -> MergePick {
General Comments 0
You need to be logged in to leave comments. Login now