# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2020-07-24 12:22:33 # Node ID 00e9c5edcd58a49cdd7bd7c2d3d0db439c5d5887 # Parent e7196f1da2b1ae9da108600bc21ca62cce1de13d merge: pass mergeresult obj instead of actions dict in _resolvetrivial() Differential Revision: https://phab.mercurial-scm.org/D8824 diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -959,26 +959,28 @@ def manifestmerge( return mresult -def _resolvetrivial(repo, wctx, mctx, ancestor, actions): +def _resolvetrivial(repo, wctx, mctx, ancestor, mresult): """Resolves false conflicts where the nodeid changed but the content remained the same.""" # We force a copy of actions.items() because we're going to mutate # actions as we resolve trivial conflicts. - for f, (m, args, msg) in list(actions.items()): + for f, (m, args, msg) in list(mresult.actions.items()): if ( m == mergestatemod.ACTION_CHANGED_DELETED and f in ancestor and not wctx[f].cmp(ancestor[f]) ): # local did change but ended up with same content - actions[f] = mergestatemod.ACTION_REMOVE, None, b'prompt same' + mresult.addfile( + f, mergestatemod.ACTION_REMOVE, None, b'prompt same' + ) elif ( m == mergestatemod.ACTION_DELETED_CHANGED and f in ancestor and not mctx[f].cmp(ancestor[f]) ): # remote did change but ended up with same content - del actions[f] # don't get = keep local deleted + mresult.removefile(f) # don't get = keep local deleted def calculateupdates( @@ -1127,7 +1129,7 @@ def calculateupdates( prunedactions = sparse.filterupdatesactions( repo, wctx, mctx, branchmerge, mresult.actions ) - _resolvetrivial(repo, wctx, mctx, ancestors[0], mresult.actions) + _resolvetrivial(repo, wctx, mctx, ancestors[0], mresult) mresult.setactions(prunedactions) return mresult