Patchwork D8829: mergeresult: rename _actions to _filemapping

login
register
mail settings
Submitter phabricator
Date July 25, 2020, 10:02 a.m.
Message ID <differential-rev-PHID-DREV-4mgt4ihted4b3usocgti-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46900/
State Superseded
Headers show

Comments

phabricator - July 25, 2020, 10:02 a.m.
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




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

Patch

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,