From patchwork Wed Dec 2 16:03:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9499: rust-copies: record overwrite when merging From: phabricator X-Patchwork-Id: 47781 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 2 Dec 2020 16:03:16 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY When detecting fresh value (from current rev) overwriting older ones during merges, we also record this overwrite for to help potential future comparison. This does really have any performance effect right now, but it get use closer to be able to drop all `is_ancestors` when merging. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9499 AFFECTED FILES rust/hg-core/src/copy_tracing.rs CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel 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 @@ -722,11 +722,13 @@ } else { // The last value comes the current merge, this value -will- win // eventually. + oracle.record_overwrite(src_minor.rev, src_major.rev); MergePick::Major } } else if src_minor.rev == current_merge { // The last value comes the current merge, this value -will- win // eventually. + oracle.record_overwrite(src_major.rev, src_minor.rev); MergePick::Minor } else if src_major.path == src_minor.path { // we have the same value, but from other source;