# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1595593153 -19800 # Node ID e7196f1da2b1ae9da108600bc21ca62cce1de13d # Parent 31c454a5f1a83b3dd9ca59db64828ad2762a48af merge: pass mergeresult obj instead of actions in _filternarrowactions() We want to use rich mergeresult object and it's APIs instead of handling a dictionary. Differential Revision: https://phab.mercurial-scm.org/D8823 diff -r 31c454a5f1a8 -r e7196f1da2b1 mercurial/merge.py --- a/mercurial/merge.py Fri Jul 24 17:31:26 2020 +0530 +++ b/mercurial/merge.py Fri Jul 24 17:49:13 2020 +0530 @@ -513,7 +513,7 @@ raise error.Abort(_(b"destination manifest contains path conflicts")) -def _filternarrowactions(narrowmatch, branchmerge, actions): +def _filternarrowactions(narrowmatch, branchmerge, mresult): """ Filters out actions that can ignored because the repo is narrowed. @@ -524,13 +524,13 @@ nonconflicttypes = set(b'a am c cm f g gs r e'.split()) # We mutate the items in the dict during iteration, so iterate # over a copy. - for f, action in list(actions.items()): + for f, action in list(mresult.actions.items()): if narrowmatch(f): pass elif not branchmerge: - del actions[f] # just updating, ignore changes outside clone + mresult.removefile(f) # just updating, ignore changes outside clone elif action[0] in nooptypes: - del actions[f] # merge does not affect file + mresult.removefile(f) # merge does not affect file elif action[0] in nonconflicttypes: raise error.Abort( _( @@ -950,7 +950,7 @@ narrowmatch = repo.narrowmatch() if not narrowmatch.always(): # Updates "actions" in place - _filternarrowactions(narrowmatch, branchmerge, mresult.actions) + _filternarrowactions(narrowmatch, branchmerge, mresult) renamedelete = branch_copies1.renamedelete renamedelete.update(branch_copies2.renamedelete)