comparison mercurial/mergestate.py @ 45385:05d19ca33b33

mergestate: replace `addmergedother()` with generic `addcommitinfo()` (API) Storing that a file is resolved for the other parent while merging is just one case of things we will like to store in the mergestate. There are more which we will like to store. This patch replaces `addmergedother()` with a much more generic `addcommitinfo()`. Doing this, we also blinding stores the same key value pair generated by the merge code instead of touching them. Differential Revision: https://phab.mercurial-scm.org/D8923
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 10 Aug 2020 15:47:21 +0530
parents 0652a533fe3c
children bb9888d32601
comparison
equal deleted inserted replaced
45384:72e503a24715 45385:05d19ca33b33
590 forigin: origin of the file ('l' or 'r' for local/remote) 590 forigin: origin of the file ('l' or 'r' for local/remote)
591 """ 591 """
592 self._state[path] = [MERGE_RECORD_UNRESOLVED_PATH, frename, forigin] 592 self._state[path] = [MERGE_RECORD_UNRESOLVED_PATH, frename, forigin]
593 self._dirty = True 593 self._dirty = True
594 594
595 def addmergedother(self, path): 595 def addcommitinfo(self, path, data):
596 self._stateextras[path] = {b'filenode-source': b'other'} 596 """ stores information which is required at commit
597 into _stateextras """
598 self._stateextras[path].update(data)
597 self._dirty = True 599 self._dirty = True
598 600
599 def __contains__(self, dfile): 601 def __contains__(self, dfile):
600 return dfile in self._state 602 return dfile in self._state
601 603