[Request] [+ ] D8923: mergestate: replace `addmergedother()` with generic `addcommitinfo()` (API)
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Mon Aug 10 11:19:04 UTC 2020
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
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.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D8923
AFFECTED FILES
mercurial/merge.py
mercurial/mergestate.py
CHANGE DETAILS
diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -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': 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):
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1365,8 +1365,7 @@
for f, op in pycompat.iteritems(mresult.commitinfo):
# the other side of filenode was choosen while merging, store this in
# mergestate so that it can be reused on commit
- if op[b'filenode'] == b'other':
- ms.addmergedother(f)
+ ms.addcommitinfo(f, op)
moves = []
To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200810/dd9eceb1/attachment.html>
More information about the Mercurial-patches
mailing list