From 63f0ebdb7f0dac851e41320e71a224077d46487c Mon Sep 17 00:00:00 2001 From: Pierre-Yves David Date: Tue, 11 Apr 2017 00:03:11 +0200 Subject: [PATCH] upgrade: simplify the "origin" dispatch in dry run We could compute the final set we need directly. --- mercurial/upgrade.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py index e25bdbb5cf..95cce6fbc9 100644 --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -664,19 +664,16 @@ def upgraderepo(ui, repo, run=False, optimize=None): ui.write('%s\n %s\n\n' % (a.name, a.upgrademessage)) if not run: - fromdefault = [] fromconfig = [] + onlydefault = [] for d in deficiencies: - if d.fromdefault: - fromdefault.append(d) if d.fromconfig: fromconfig.append(d) + elif d.fromdefault: + onlydefault.append(d) - if fromdefault or fromconfig: - fromconfignames = set(x.name for x in fromconfig) - onlydefault = [i for i in fromdefault - if i.name not in fromconfignames] + if fromconfig or onlydefault: if fromconfig: ui.write(_('repository lacks features recommended by '