upgrade: simplify the "origin" dispatch in dry run

We could compute the final set we need directly.
This commit is contained in:
Pierre-Yves David 2017-04-11 00:03:11 +02:00
parent 0befb32302
commit 63f0ebdb7f

View File

@ -664,19 +664,16 @@ def upgraderepo(ui, repo, run=False, optimize=None):
ui.write('%s\n %s\n\n' % (a.name, a.upgrademessage)) ui.write('%s\n %s\n\n' % (a.name, a.upgrademessage))
if not run: if not run:
fromdefault = []
fromconfig = [] fromconfig = []
onlydefault = []
for d in deficiencies: for d in deficiencies:
if d.fromdefault:
fromdefault.append(d)
if d.fromconfig: if d.fromconfig:
fromconfig.append(d) fromconfig.append(d)
elif d.fromdefault:
onlydefault.append(d)
if fromdefault or fromconfig: if fromconfig or onlydefault:
fromconfignames = set(x.name for x in fromconfig)
onlydefault = [i for i in fromdefault
if i.name not in fromconfignames]
if fromconfig: if fromconfig:
ui.write(_('repository lacks features recommended by ' ui.write(_('repository lacks features recommended by '