upgrade: simplify 'determineactions'
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Fri, 07 Apr 2017 18:39:27 +0200
changeset 31900 0f0d7005b9ad
parent 31899 cccd8e1538b0
child 31901 9bdedb050d8d
upgrade: simplify 'determineactions' Since we only takes 'deficiencies', we can simplify the function and clarify its arguments.
mercurial/upgrade.py
--- a/mercurial/upgrade.py	Tue Apr 11 23:46:16 2017 +0200
+++ b/mercurial/upgrade.py	Fri Apr 07 18:39:27 2017 +0200
@@ -261,7 +261,7 @@
 
     return optimizations
 
-def determineactions(repo, improvements, sourcereqs, destreqs):
+def determineactions(repo, deficiencies, sourcereqs, destreqs):
     """Determine upgrade actions that will be performed.
 
     Given a list of improvements as returned by ``finddeficiencies`` and
@@ -278,16 +278,15 @@
 
     knownreqs = supporteddestrequirements(repo)
 
-    for i in improvements:
-        name = i.name
+    for d in deficiencies:
+        name = d.name
 
         # If the action is a requirement that doesn't show up in the
         # destination requirements, prune the action.
         if name in knownreqs and name not in destreqs:
             continue
 
-        if i.type == deficiency:
-            newactions.append(name)
+        newactions.append(name)
 
     # FUTURE consider adding some optimizations here for certain transitions.
     # e.g. adding generaldelta could schedule parent redeltas.