upgrade: simplify some of the initial dispatch for dry run
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 10 Apr 2017 22:15:17 +0200
changeset 31901 9bdedb050d8d
parent 31900 0f0d7005b9ad
child 31902 6557f0d4ab8e
upgrade: simplify some of the initial dispatch for dry run Since we already have the list of deficiencies, we can use it directly.
mercurial/upgrade.py
--- 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)