# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2020-09-25 08:28:05 # Node ID 9f14bb4d59ea4475e54c51ab15997230552bfc83 # Parent 463ca8af8c72ab8c7c355e5e3d4d5793cac4e724 mergestate: update _stateextras instead of reassinging `merge.applyupdates()` can store extras for a file and _stateextras may not be empty always. Hence reassigning loses the old values. We can directly update like this because we switched to using `collections.defaultdict` for `_stateextras` sometime ago. diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py --- a/mercurial/mergestate.py +++ b/mercurial/mergestate.py @@ -261,7 +261,7 @@ class _mergestate_base(object): hex(fco.filenode()), fcl.flags(), ] - self._stateextras[fd] = {b'ancestorlinknode': hex(fca.node())} + self._stateextras[fd][b'ancestorlinknode'] = hex(fca.node()) self._dirty = True def addpathconflict(self, path, frename, forigin):