comparison mercurial/merge.py @ 45309:3f5ac87ae10f

merge: introduce mergeresult.updateactions() and use it We don't want direct editing and access of mergeresult._actions because soon we will like to maintain data in other structures also. Differential Revision: https://phab.mercurial-scm.org/D8826
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 24 Jul 2020 18:16:29 +0530
parents 4ad6c4e9e35f
children 1d1f112da75c
comparison
equal deleted inserted replaced
45308:4ad6c4e9e35f 45309:3f5ac87ae10f
619 619
620 return actions 620 return actions
621 621
622 def setactions(self, actions): 622 def setactions(self, actions):
623 self._actions = actions 623 self._actions = actions
624
625 def updateactions(self, updates):
626 self._actions.update(updates)
624 627
625 def hasconflicts(self): 628 def hasconflicts(self):
626 """ tells whether this merge resulted in some actions which can 629 """ tells whether this merge resulted in some actions which can
627 result in conflicts or not """ 630 result in conflicts or not """
628 for _f, (m, _unused, _unused) in pycompat.iteritems(self._actions): 631 for _f, (m, _unused, _unused) in pycompat.iteritems(self._actions):
1123 # TODO: think about commitinfo when bid merge is used 1126 # TODO: think about commitinfo when bid merge is used
1124 mresult.updatevalues(diverge, renamedelete, {}) 1127 mresult.updatevalues(diverge, renamedelete, {})
1125 1128
1126 if wctx.rev() is None: 1129 if wctx.rev() is None:
1127 fractions = _forgetremoved(wctx, mctx, branchmerge) 1130 fractions = _forgetremoved(wctx, mctx, branchmerge)
1128 mresult.actions.update(fractions) 1131 mresult.updateactions(fractions)
1129 1132
1130 prunedactions = sparse.filterupdatesactions( 1133 prunedactions = sparse.filterupdatesactions(
1131 repo, wctx, mctx, branchmerge, mresult.actions 1134 repo, wctx, mctx, branchmerge, mresult.actions
1132 ) 1135 )
1133 _resolvetrivial(repo, wctx, mctx, ancestors[0], mresult) 1136 _resolvetrivial(repo, wctx, mctx, ancestors[0], mresult)