diff hgext/convert/hg.py @ 45274:0e18861f96ab

merge: return a mergeresult obj from manifestmerge(), calculateupdates() (API) Earlier, manifestmerge() and calculateupdates() returns a tuple of three things. I wanted to add one more thing to return value. Introducing a special class which represents results of a merge will help understand better and also ease adding new return values. Differential Revision: https://phab.mercurial-scm.org/D8799
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 23 Jul 2020 18:03:14 +0530
parents 9d2b2df2c2ba
children 8e8d513941b4
line wrap: on
line diff
--- a/hgext/convert/hg.py	Thu Jul 30 22:49:51 2020 -0700
+++ b/hgext/convert/hg.py	Thu Jul 23 18:03:14 2020 +0530
@@ -217,7 +217,7 @@
         """
         anc = [p1ctx.ancestor(p2ctx)]
         # Calculate what files are coming from p2
-        actions, diverge, rename = mergemod.calculateupdates(
+        mresult = mergemod.calculateupdates(
             self.repo,
             p1ctx,
             p2ctx,
@@ -228,7 +228,7 @@
             followcopies=False,
         )
 
-        for file, (action, info, msg) in pycompat.iteritems(actions):
+        for file, (action, info, msg) in pycompat.iteritems(mresult.actions):
             if source.targetfilebelongstosource(file):
                 # If the file belongs to the source repo, ignore the p2
                 # since it will be covered by the existing fileset.