Mercurial > hg
changeset 31900:0f0d7005b9ad
upgrade: simplify 'determineactions'
Since we only takes 'deficiencies', we can simplify the function and clarify its
arguments.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 07 Apr 2017 18:39:27 +0200 |
parents | cccd8e1538b0 |
children | 9bdedb050d8d |
files | mercurial/upgrade.py |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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.