upgrade: simplify 'determineactions'
Since we only takes 'deficiencies', we can simplify the function and clarify its
arguments.
--- 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.