Patchwork D9499: rust-copies: record overwrite when merging

login
register
mail settings
Submitter phabricator
Date Dec. 2, 2020, 4:03 p.m.
Message ID <differential-rev-PHID-DREV-qjxsgkk2va4p5u4semwp-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47781/
State Superseded
Headers show

Comments

phabricator - Dec. 2, 2020, 4:03 p.m.
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

Patch

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;