Mercurial > public > mercurial-scm > hg-stable
diff mercurial/mergestate.py @ 45405: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 |
line wrap: on
line diff
--- a/mercurial/mergestate.py Mon Aug 10 15:38:45 2020 +0530 +++ b/mercurial/mergestate.py Mon Aug 10 15:47:21 2020 +0530 @@ -592,8 +592,10 @@ self._state[path] = [MERGE_RECORD_UNRESOLVED_PATH, frename, forigin] self._dirty = True - def addmergedother(self, path): - self._stateextras[path] = {b'filenode-source': b'other'} + def addcommitinfo(self, path, data): + """ stores information which is required at commit + into _stateextras """ + self._stateextras[path].update(data) self._dirty = True def __contains__(self, dfile):