D9499: rust-copies: record overwrite when merging

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Dec 2 16:03:16 UTC 2020


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

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;



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list