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