copies-rust: record overwrite when merging
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 02 Dec 2020 15:37:54 +0100
changeset 46157 021925827c60
parent 46156 7d99614b7b77
child 46158 1fcfff09cac5
copies-rust: record overwrite when merging 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. Differential Revision: https://phab.mercurial-scm.org/D9499
rust/hg-core/src/copy_tracing.rs
--- a/rust/hg-core/src/copy_tracing.rs	Wed Dec 02 15:24:10 2020 +0100
+++ b/rust/hg-core/src/copy_tracing.rs	Wed Dec 02 15:37:54 2020 +0100
@@ -731,11 +731,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;