D8829: mergeresult: rename _actions to _filemapping

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sat Jul 25 10:02:45 UTC 2020


pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is done because we will be introducing another dict which introduces the
  same information but with action name as key.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8829

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -557,7 +557,7 @@
 
     def __init__(self):
         """
-        actions: dict of filename as keys and action related info as values
+        filemapping: dict of filename as keys and action related info as values
         diverge: mapping of source name -> list of dest name for
                  divergent renames
         renamedelete: mapping of source name -> list of destinations for files
@@ -565,7 +565,7 @@
         commitinfo: dict containing data which should be used on commit
                     contains a filename -> info mapping
         """
-        self._actions = {}
+        self._filemapping = {}
         self._diverge = {}
         self._renamedelete = {}
         self._commitinfo = {}
@@ -583,16 +583,16 @@
         data: a tuple of information like fctx and ctx related to this merge
         message: a message about the merge
         """
-        self._actions[filename] = (action, data, message)
+        self._filemapping[filename] = (action, data, message)
 
     def removefile(self, filename):
         """ removes a file from the mergeresult object as the file might
         not merging anymore """
-        del self._actions[filename]
+        del self._filemapping[filename]
 
     @property
     def actions(self):
-        return self._actions
+        return self._filemapping
 
     @property
     def diverge(self):
@@ -612,7 +612,7 @@
         and a list of files and related arguments as values """
         # Convert to dictionary-of-lists format
         actions = emptyactions()
-        for f, (m, args, msg) in pycompat.iteritems(self._actions):
+        for f, (m, args, msg) in pycompat.iteritems(self._filemapping):
             if m not in actions:
                 actions[m] = []
             actions[m].append((f, args, msg))
@@ -620,15 +620,15 @@
         return actions
 
     def setactions(self, actions):
-        self._actions = actions
+        self._filemapping = actions
 
     def updateactions(self, updates):
-        self._actions.update(updates)
+        self._filemapping.update(updates)
 
     def hasconflicts(self):
         """ tells whether this merge resulted in some actions which can
         result in conflicts or not """
-        for _, (m, _, _) in pycompat.iteritems(self._actions):
+        for _, (m, _, _) in pycompat.iteritems(self._filemapping):
             if m not in (
                 mergestatemod.ACTION_GET,
                 mergestatemod.ACTION_KEEP,



To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list