Patchwork D8826: merge: introduce mergeresult.updateactions() and use it

login
register
mail settings
Submitter phabricator
Date July 25, 2020, 10:01 a.m.
Message ID <differential-rev-PHID-DREV-ocmg4u2kp7hdbc7mzsge-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46897/
State Superseded
Headers show

Comments

phabricator - July 25, 2020, 10:01 a.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We don't want direct editing and access of mergeresult._actions because soon we
  will like to maintain data in other structures also.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -622,6 +622,9 @@ 
     def setactions(self, actions):
         self._actions = actions
 
+    def updateactions(self, updates):
+        self._actions.update(updates)
+
     def hasconflicts(self):
         """ tells whether this merge resulted in some actions which can
         result in conflicts or not """
@@ -1125,7 +1128,7 @@ 
 
     if wctx.rev() is None:
         fractions = _forgetremoved(wctx, mctx, branchmerge)
-        mresult.actions.update(fractions)
+        mresult.updateactions(fractions)
 
     prunedactions = sparse.filterupdatesactions(
         repo, wctx, mctx, branchmerge, mresult.actions