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

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sat Aug 22 23:33:31 UTC 2020


Closed by commit rHG05d19ca33b33: mergestate: replace `addmergedother()` with generic `addcommitinfo()` (API) (authored by pulkit).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

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

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, indygreg
Cc: marmoute, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200822/cc8baa4c/attachment-0002.html>


More information about the Mercurial-patches mailing list