Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade.py @ 31904:3c77f03f16b3
upgrade: simplify the "origin" dispatch in dry run
We could compute the final set we need directly.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 11 Apr 2017 00:03:11 +0200 |
parents | fa1088de2119 |
children | 99f63f476a72 |
comparison
equal
deleted
inserted
replaced
31903:fa1088de2119 | 31904:3c77f03f16b3 |
---|---|
662 def printupgradeactions(): | 662 def printupgradeactions(): |
663 for a in actions: | 663 for a in actions: |
664 ui.write('%s\n %s\n\n' % (a.name, a.upgrademessage)) | 664 ui.write('%s\n %s\n\n' % (a.name, a.upgrademessage)) |
665 | 665 |
666 if not run: | 666 if not run: |
667 fromdefault = [] | |
668 fromconfig = [] | 667 fromconfig = [] |
668 onlydefault = [] | |
669 | 669 |
670 for d in deficiencies: | 670 for d in deficiencies: |
671 if d.fromdefault: | |
672 fromdefault.append(d) | |
673 if d.fromconfig: | 671 if d.fromconfig: |
674 fromconfig.append(d) | 672 fromconfig.append(d) |
675 | 673 elif d.fromdefault: |
676 if fromdefault or fromconfig: | 674 onlydefault.append(d) |
677 fromconfignames = set(x.name for x in fromconfig) | 675 |
678 onlydefault = [i for i in fromdefault | 676 if fromconfig or onlydefault: |
679 if i.name not in fromconfignames] | |
680 | 677 |
681 if fromconfig: | 678 if fromconfig: |
682 ui.write(_('repository lacks features recommended by ' | 679 ui.write(_('repository lacks features recommended by ' |
683 'current config options:\n\n')) | 680 'current config options:\n\n')) |
684 for i in fromconfig: | 681 for i in fromconfig: |