##// END OF EJS Templates
copies-rust: record "overwritten" information from both side on delete...
marmoute -
r47323:d6d57bfc default
parent child Browse files
Show More
@@ -75,6 +75,19 b' impl CopySource {'
75 self.path = None;
75 self.path = None;
76 }
76 }
77
77
78 /// Mark pre-existing copy information as "dropped" by a file deletion
79 ///
80 /// Use this when recording copy information from parent → child edges
81 fn mark_delete_with_pair(&mut self, rev: Revision, other: &Self) {
82 self.overwritten.insert(self.rev);
83 if other.rev != rev {
84 self.overwritten.insert(other.rev);
85 }
86 self.overwritten.extend(other.overwritten.iter().copied());
87 self.rev = rev;
88 self.path = None;
89 }
90
78 fn is_overwritten_by(&self, other: &Self) -> bool {
91 fn is_overwritten_by(&self, other: &Self) -> bool {
79 other.overwritten.contains(&self.rev)
92 other.overwritten.contains(&self.rev)
80 }
93 }
@@ -535,8 +548,10 b' fn chain_changes('
535 e.get_mut().mark_delete(current_rev)
548 e.get_mut().mark_delete(current_rev)
536 }
549 }
537 (Some(mut e1), Some(mut e2)) => {
550 (Some(mut e1), Some(mut e2)) => {
538 e1.get_mut().mark_delete(current_rev);
551 let cs1 = e1.get_mut();
539 e2.get_mut().mark_delete(current_rev);
552 let cs2 = e2.get();
553 cs1.mark_delete_with_pair(current_rev, &cs2);
554 e2.insert(cs1.clone());
540 }
555 }
541 }
556 }
542 }
557 }
General Comments 0
You need to be logged in to leave comments. Login now