diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -548,6 +548,7 @@ clean_p1=False, clean_p2=False, possibly_dirty=False, + parentfiledata=None, ): """update the information about a file in the dirstate @@ -583,19 +584,11 @@ elif possibly_dirty: self._addpath(filename, possibly_dirty=possibly_dirty) elif wc_tracked: - self.normal(filename) + self.normal(filename, parentfiledata=parentfiledata) # XXX We need something for file that are dirty after an update else: assert False, 'unreachable' - @requires_parents_change - def update_parent_file_data(self, f, filedata): - """update the information about the content of a file - - This function should be called within a `dirstate.parentchange` context. - """ - self.normal(f, parentfiledata=filedata) - def _addpath( self, f, diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py --- a/mercurial/mergestate.py +++ b/mercurial/mergestate.py @@ -801,7 +801,12 @@ ) else: parentfiledata = getfiledata[f] if getfiledata else None - repo.dirstate.update_parent_file_data(f, parentfiledata) + repo.dirstate.update_file( + f, + p1_tracked=True, + wc_tracked=True, + parentfiledata=parentfiledata, + ) # merge for f, args, msg in actions.get(ACTION_MERGE, []):