[Updated] D8923: mergestate: replace `addmergedother()` with generic `addcommitinfo()` (API)

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Tue Aug 11 07:47:34 UTC 2020


pulkit updated this revision to Diff 22395.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8923?vs=22378&id=22395

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8923/new/

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-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):
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1367,8 +1367,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-source'] == b'other':
-            ms.addmergedother(f)
+        ms.addcommitinfo(f, op)
 
     moves = []
 



To: pulkit, #hg-reviewers, marmoute
Cc: marmoute, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200811/26c4d173/attachment-0002.html>


More information about the Mercurial-patches mailing list