changeset 45470:6e474eec4be6

merge: update commitinfo from all mergeresults during bid merge 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. Differential Revision: https://phab.mercurial-scm.org/D8965
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 26 Aug 2020 16:37:23 +0530
parents 49ffaa4f65f6
children a03fde1077ce
files mercurial/merge.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Mon Aug 24 17:22:28 2020 +0530
+++ b/mercurial/merge.py	Wed Aug 26 16:37:23 2020 +0530
@@ -1130,6 +1130,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)
@@ -1156,6 +1157,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))
@@ -1174,7 +1181,6 @@
             _(b'\nauction for merging merge bids (%d ancestors)\n')
             % len(ancestors)
         )
-        mresult = mergeresult()
         for f, bids in sorted(fbids.items()):
             if repo.ui.debugflag:
                 repo.ui.debug(b" list of bids for %s:\n" % f)