changeset 45349:442823f66889

merge: drop commitinfo argument to applyupdates (API) We now pass the mergeresult object and hence there is no need to have a separate commitinfo argument as the required info is present in mergeresult object. Differential Revision: https://phab.mercurial-scm.org/D8904
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 06 Aug 2020 13:51:43 +0530
parents 490607efc992
children 1c8e3c17c702
files mercurial/merge.py
diffstat 1 files changed, 3 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Thu Aug 06 13:27:38 2020 +0530
+++ b/mercurial/merge.py	Thu Aug 06 13:51:43 2020 +0530
@@ -1339,22 +1339,13 @@
 
 
 def applyupdates(
-    repo,
-    mresult,
-    wctx,
-    mctx,
-    overwrite,
-    wantfiledata,
-    labels=None,
-    commitinfo=None,
+    repo, mresult, wctx, mctx, overwrite, wantfiledata, labels=None,
 ):
     """apply the merge action list to the working directory
 
     mresult is a mergeresult object representing result of the merge
     wctx is the working copy context
     mctx is the context to be merged into the working copy
-    commitinfo is a mapping of information which needs to be stored somewhere
-               (probably mergestate) so that it can be used at commit time.
 
     Return a tuple of (counts, filedata), where counts is a tuple
     (updated, merged, removed, unresolved) that describes how many
@@ -1369,10 +1360,7 @@
         repo, wctx.p1().node(), mctx.node(), labels
     )
 
-    if commitinfo is None:
-        commitinfo = {}
-
-    for f, op in pycompat.iteritems(commitinfo):
+    for f, op in pycompat.iteritems(mresult.commitinfo):
         # the other side of filenode was choosen while merging, store this in
         # mergestate so that it can be reused on commit
         if op == b'other':
@@ -2051,14 +2039,7 @@
 
         wantfiledata = updatedirstate and not branchmerge
         stats, getfiledata = applyupdates(
-            repo,
-            mresult,
-            wc,
-            p2,
-            overwrite,
-            wantfiledata,
-            labels=labels,
-            commitinfo=mresult.commitinfo,
+            repo, mresult, wc, p2, overwrite, wantfiledata, labels=labels,
         )
 
         if updatedirstate: