diff mercurial/upgrade_utils/actions.py @ 46205:53d083fa1f83

upgrade: rename finddeficiences() to find_format_upgrades() It was not obvious what does deficieny means and every format upgrade can't be a deficiency. There are some format upgrades like compression levels, share-safe which can't be understood at deficiencies. A change can be an upgrade or downgrade, however this `finddeficiences()` only used to find upgrades. This patch renames the function and related variables to make things more clearer. The ui message also got improved which is a good thing. Next patch will rename deficiency in general across the upgrade code. Differential Revision: https://phab.mercurial-scm.org/D9582
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 14 Dec 2020 16:03:15 +0530
parents 25d11b24dedf
children 9540945e51fd
line wrap: on
line diff
--- a/mercurial/upgrade_utils/actions.py	Sat Jan 02 01:48:12 2021 -0500
+++ b/mercurial/upgrade_utils/actions.py	Mon Dec 14 16:03:15 2020 +0530
@@ -410,9 +410,9 @@
         return bytes(level)
 
 
-def finddeficiencies(repo):
-    """returns a list of deficiencies that the repo suffer from"""
-    deficiencies = []
+def find_format_upgrades(repo):
+    """returns a list of format upgrades which can be perform on the repo"""
+    upgrades = []
 
     # We could detect lack of revlogv1 and store here, but they were added
     # in 0.9.2 and we don't support upgrading repos without these
@@ -420,9 +420,9 @@
 
     for fv in allformatvariant:
         if not fv.fromrepo(repo):
-            deficiencies.append(fv)
+            upgrades.append(fv)
 
-    return deficiencies
+    return upgrades
 
 
 ALL_OPTIMISATIONS = []
@@ -523,10 +523,10 @@
     return list(ALL_OPTIMISATIONS)
 
 
-def determineactions(repo, deficiencies, sourcereqs, destreqs):
+def determineactions(repo, format_upgrades, sourcereqs, destreqs):
     """Determine upgrade actions that will be performed.
 
-    Given a list of improvements as returned by ``finddeficiencies`` and
+    Given a list of improvements as returned by ``find_format_upgrades`` and
     ``findoptimizations``, determine the list of upgrade actions that
     will be performed.
 
@@ -538,7 +538,7 @@
     """
     newactions = []
 
-    for d in deficiencies:
+    for d in format_upgrades:
         name = d._requirement
 
         # If the action is a requirement that doesn't show up in the