# HG changeset patch # User Pierre-Yves David # Date 1491583167 -7200 # Node ID 0f0d7005b9ad6a84c36cf90ed711bbc96797133a # Parent cccd8e1538b0eca6a1806ab889428257e4297d76 upgrade: simplify 'determineactions' Since we only takes 'deficiencies', we can simplify the function and clarify its arguments. diff -r cccd8e1538b0 -r 0f0d7005b9ad 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.