Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade.py @ 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 |
comparison
equal
deleted
inserted
replaced
31900:0f0d7005b9ad | 31901:9bdedb050d8d |
---|---|
662 (i.name, i.upgrademessage)) | 662 (i.name, i.upgrademessage)) |
663 | 663 |
664 if not run: | 664 if not run: |
665 fromdefault = [] | 665 fromdefault = [] |
666 fromconfig = [] | 666 fromconfig = [] |
667 optimizations = [] | 667 |
668 | 668 for d in deficiencies: |
669 for i in improvements: | 669 if d.fromdefault: |
670 assert i.type in (deficiency, optimisation) | 670 fromdefault.append(d) |
671 if i.type == deficiency: | 671 if d.fromconfig: |
672 if i.fromdefault: | 672 fromconfig.append(d) |
673 fromdefault.append(i) | |
674 if i.fromconfig: | |
675 fromconfig.append(i) | |
676 else: | |
677 optimizations.append(i) | |
678 | 673 |
679 if fromdefault or fromconfig: | 674 if fromdefault or fromconfig: |
680 fromconfignames = set(x.name for x in fromconfig) | 675 fromconfignames = set(x.name for x in fromconfig) |
681 onlydefault = [i for i in fromdefault | 676 onlydefault = [i for i in fromdefault |
682 if i.name not in fromconfignames] | 677 if i.name not in fromconfignames] |