[Commented On] D9652: copies-rust: record "overwritten" information from both side on delete
baymax (Baymax, Your Personal Patch-care Companion)
phabricator at mercurial-scm.org
Fri Jan 8 23:16:40 UTC 2021
baymax added a comment.
baymax updated this revision to Diff 24677.
✅ refresh by Heptapod after a successful CI run (🐙 💚)
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D9652?vs=24586&id=24677
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D9652/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D9652
AFFECTED FILES
rust/hg-core/src/copy_tracing.rs
CHANGE DETAILS
diff --git a/rust/hg-core/src/copy_tracing.rs b/rust/hg-core/src/copy_tracing.rs
--- a/rust/hg-core/src/copy_tracing.rs
+++ b/rust/hg-core/src/copy_tracing.rs
@@ -75,6 +75,19 @@
self.path = None;
}
+ /// Mark pre-existing copy information as "dropped" by a file deletion
+ ///
+ /// Use this when recording copy information from parent → child edges
+ fn mark_delete_with_pair(&mut self, rev: Revision, other: &Self) {
+ self.overwritten.insert(self.rev);
+ if other.rev != rev {
+ self.overwritten.insert(other.rev);
+ }
+ self.overwritten.extend(other.overwritten.iter().copied());
+ self.rev = rev;
+ self.path = None;
+ }
+
fn is_overwritten_by(&self, other: &Self) -> bool {
other.overwritten.contains(&self.rev)
}
@@ -535,8 +548,10 @@
e.get_mut().mark_delete(current_rev)
}
(Some(mut e1), Some(mut e2)) => {
- e1.get_mut().mark_delete(current_rev);
- e2.get_mut().mark_delete(current_rev);
+ let cs1 = e1.get_mut();
+ let cs2 = e2.get();
+ cs1.mark_delete_with_pair(current_rev, &cs2);
+ e2.insert(cs1.clone());
}
}
}
To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210108/61f0d09a/attachment-0002.html>
More information about the Mercurial-patches
mailing list