Patchwork D8965: merge: update commitinfo from all mergeresults during bid merge

login
register
mail settings
Submitter phabricator
Date Aug. 27, 2020, 9:39 a.m.
Message ID <differential-rev-PHID-DREV-27r4ppq7udhsvsd46vfk-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47066/
State Superseded
Headers show

Comments

phabricator - Aug. 27, 2020, 9:39 a.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  During bid merge, it's not clear which commitinfo should be stored and which one
  should not. This depends on which side the bid merge chooses for a file. For
  this we will need to refactor bid merge code and commitinfo handling.
  
  For now, we just blindly updates info since we hardly have any users of
  commitinfo and this will help us in testing and clearing out further path.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8965

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1126,6 +1126,7 @@ 
         # mapping of following form:
         # {ACTION_X : [info, ..], ACTION_Y : [info, ..]}
         fbids = {}
+        mresult = mergeresult()
         diverge, renamedelete = None, None
         for ancestor in ancestors:
             repo.ui.note(_(b'\ncalculating bids for ancestor %s\n') % ancestor)
@@ -1152,6 +1153,12 @@ 
             ):
                 renamedelete = mresult1.renamedelete
 
+            # blindly update final mergeresult commitinfo with what we get
+            # from mergeresult object for each ancestor
+            # TODO: some commitinfo depends on what bid merge choose and hence
+            # we will need to make commitinfo also depend on bid merge logic
+            mresult._commitinfo.update(mresult1._commitinfo)
+
             for f, a in mresult1.filemap(sort=True):
                 m, args, msg = a
                 repo.ui.debug(b' %s: %s -> %s\n' % (f, msg, m))
@@ -1167,7 +1174,6 @@ 
         # Call for bids
         # Pick the best bid for each file
         repo.ui.note(_(b'\nauction for merging merge bids\n'))
-        mresult = mergeresult()
         for f, bids in sorted(fbids.items()):
             # bids is a mapping from action method to list af actions
             # Consensus?