##// END OF EJS Templates
copies-rust: start recording overwrite as they happens...
marmoute -
r46770:fce2f20a default
parent child Browse files
Show More
@@ -243,6 +243,10 b" impl<'a, A: Fn(Revision, Revision) -> bo"
243 }
243 }
244 }
244 }
245
245
246 fn record_overwrite(&mut self, anc: Revision, desc: Revision) {
247 self.pairs.insert((anc, desc), true);
248 }
249
246 /// returns `true` if `anc` is an ancestors of `desc`, `false` otherwise
250 /// returns `true` if `anc` is an ancestors of `desc`, `false` otherwise
247 fn is_overwrite(&mut self, anc: Revision, desc: Revision) -> bool {
251 fn is_overwrite(&mut self, anc: Revision, desc: Revision) -> bool {
248 if anc > desc {
252 if anc > desc {
@@ -390,6 +394,7 b' pub fn combine_changeset_copies<A: Fn(Re'
390 // combine it with data for that revision
394 // combine it with data for that revision
391 let vertex_copies = add_from_changes(
395 let vertex_copies = add_from_changes(
392 &mut path_map,
396 &mut path_map,
397 &mut oracle,
393 &parent_copies,
398 &parent_copies,
394 &changes,
399 &changes,
395 Parent::FirstParent,
400 Parent::FirstParent,
@@ -410,6 +415,7 b' pub fn combine_changeset_copies<A: Fn(Re'
410 // combine it with data for that revision
415 // combine it with data for that revision
411 let vertex_copies = add_from_changes(
416 let vertex_copies = add_from_changes(
412 &mut path_map,
417 &mut path_map,
418 &mut oracle,
413 &parent_copies,
419 &parent_copies,
414 &changes,
420 &changes,
415 Parent::SecondParent,
421 Parent::SecondParent,
@@ -485,8 +491,9 b' fn get_and_clean_parent_copies('
485
491
486 /// Combine ChangedFiles with some existing PathCopies information and return
492 /// Combine ChangedFiles with some existing PathCopies information and return
487 /// the result
493 /// the result
488 fn add_from_changes(
494 fn add_from_changes<A: Fn(Revision, Revision) -> bool>(
489 path_map: &mut TwoWayPathMap,
495 path_map: &mut TwoWayPathMap,
496 oracle: &mut AncestorOracle<A>,
490 base_copies: &TimeStampedPathCopies,
497 base_copies: &TimeStampedPathCopies,
491 changes: &ChangedFiles,
498 changes: &ChangedFiles,
492 parent: Parent,
499 parent: Parent,
@@ -521,6 +528,7 b' fn add_from_changes('
521 }
528 }
522 Entry::Occupied(mut slot) => {
529 Entry::Occupied(mut slot) => {
523 let mut ttpc = slot.get_mut();
530 let mut ttpc = slot.get_mut();
531 oracle.record_overwrite(ttpc.rev, current_rev);
524 ttpc.rev = current_rev;
532 ttpc.rev = current_rev;
525 ttpc.path = entry;
533 ttpc.path = entry;
526 }
534 }
@@ -534,6 +542,7 b' fn add_from_changes('
534 // TimeStampedPathCopies object.
542 // TimeStampedPathCopies object.
535 let deleted = path_map.tokenize(deleted_path);
543 let deleted = path_map.tokenize(deleted_path);
536 copies.entry(deleted).and_modify(|old| {
544 copies.entry(deleted).and_modify(|old| {
545 oracle.record_overwrite(old.rev, current_rev);
537 old.rev = current_rev;
546 old.rev = current_rev;
538 old.path = None;
547 old.path = None;
539 });
548 });
General Comments 0
You need to be logged in to leave comments. Login now