# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2020-07-24 10:53:55 # Node ID f1fb9a0791319b63427ef93f420faea9abea2eea # Parent b442920ab1debcdf53ff857f3306a316e397d998 merge: add removefile() to mergeresult object There are cases where some further calculation makes the file not needing to be merged anymore and hence needs to be dropped in mergeresult object. This adds a function for that. Differential Revision: https://phab.mercurial-scm.org/D8821 diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -576,6 +576,11 @@ class mergeresult(object): """ self._actions[filename] = (action, data, message) + def removefile(self, filename): + """ removes a file from the mergeresult object as the file might + not merging anymore """ + del self._actions[filename] + @property def actions(self): return self._actions @@ -1929,7 +1934,7 @@ def update( b'prompt recreating', ) else: - del mresult.actions[f] + mresult.removefile(f) # Convert to dictionary-of-lists format actions = mresult.actionsdict