changeset 31901:9bdedb050d8d

upgrade: simplify some of the initial dispatch for dry run Since we already have the list of deficiencies, we can use it directly.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 10 Apr 2017 22:15:17 +0200
parents 0f0d7005b9ad
children 6557f0d4ab8e
files mercurial/upgrade.py
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/upgrade.py	Fri Apr 07 18:39:27 2017 +0200
+++ b/mercurial/upgrade.py	Mon Apr 10 22:15:17 2017 +0200
@@ -664,17 +664,12 @@
     if not run:
         fromdefault = []
         fromconfig = []
-        optimizations = []
 
-        for i in improvements:
-            assert i.type in (deficiency, optimisation)
-            if i.type == deficiency:
-                if i.fromdefault:
-                    fromdefault.append(i)
-                if i.fromconfig:
-                    fromconfig.append(i)
-            else:
-                optimizations.append(i)
+        for d in deficiencies:
+            if d.fromdefault:
+                fromdefault.append(d)
+            if d.fromconfig:
+                fromconfig.append(d)
 
         if fromdefault or fromconfig:
             fromconfignames = set(x.name for x in fromconfig)