Show More
@@ -503,6 +503,42 fn add_from_changes( | |||
|
503 | 503 | for action in changes.iter_actions(parent) { |
|
504 | 504 | match action { |
|
505 | 505 | Action::Copied(path_dest, path_source) => { |
|
506 | add_one_copy( | |
|
507 | current_rev, | |
|
508 | &mut path_map, | |
|
509 | &mut copies, | |
|
510 | &base_copies, | |
|
511 | path_dest, | |
|
512 | path_source, | |
|
513 | ); | |
|
514 | } | |
|
515 | Action::Removed(deleted_path) => { | |
|
516 | // We must drop copy information for removed file. | |
|
517 | // | |
|
518 | // We need to explicitly record them as dropped to | |
|
519 | // propagate this information when merging two | |
|
520 | // InternalPathCopies object. | |
|
521 | let deleted = path_map.tokenize(deleted_path); | |
|
522 | copies.entry(deleted).and_modify(|old| { | |
|
523 | old.mark_delete(current_rev); | |
|
524 | }); | |
|
525 | } | |
|
526 | } | |
|
527 | } | |
|
528 | copies | |
|
529 | } | |
|
530 | ||
|
531 | // insert one new copy information in an InternalPathCopies | |
|
532 | // | |
|
533 | // This deal with chaining and overwrite. | |
|
534 | fn add_one_copy( | |
|
535 | current_rev: Revision, | |
|
536 | path_map: &mut TwoWayPathMap, | |
|
537 | copies: &mut InternalPathCopies, | |
|
538 | base_copies: &InternalPathCopies, | |
|
539 | path_dest: &HgPath, | |
|
540 | path_source: &HgPath, | |
|
541 | ) { | |
|
506 | 542 |
|
|
507 | 543 |
|
|
508 | 544 |
|
@@ -529,21 +565,6 fn add_from_changes( | |||
|
529 | 565 |
|
|
530 | 566 | } |
|
531 | 567 | } |
|
532 | Action::Removed(deleted_path) => { | |
|
533 | // We must drop copy information for removed file. | |
|
534 | // | |
|
535 | // We need to explicitly record them as dropped to | |
|
536 | // propagate this information when merging two | |
|
537 | // InternalPathCopies object. | |
|
538 | let deleted = path_map.tokenize(deleted_path); | |
|
539 | copies.entry(deleted).and_modify(|old| { | |
|
540 | old.mark_delete(current_rev); | |
|
541 | }); | |
|
542 | } | |
|
543 | } | |
|
544 | } | |
|
545 | copies | |
|
546 | } | |
|
547 | 568 | |
|
548 | 569 | /// merge two copies-mapping together, minor and major |
|
549 | 570 | /// |
General Comments 0
You need to be logged in to leave comments.
Login now