comparison mercurial/upgrade.py @ 44746:c36a3fcfc36b stable

upgrade: properly filter action depending on planned work The `determineactions` function filters out deficiency that are not scheduled to be fixed by the target repository configuration. However it only did so for requirement we currently support, letting other actions for unsupported requirement through even if the target repo configuration did not request it. As a result the output of the command was easily polluted by experimental feature with no upgrade support. We rework the code to still filter out requirement based action without the faulty filtering. Differential Revision: https://phab.mercurial-scm.org/D8427
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Apr 2020 18:10:19 +0200
parents 9d2b2df2c2ba
children 5ee4b2119af9
comparison
equal deleted inserted replaced
44745:b4537125eb3c 44746:c36a3fcfc36b
626 626
627 Returns a list of action names. 627 Returns a list of action names.
628 """ 628 """
629 newactions = [] 629 newactions = []
630 630
631 knownreqs = supporteddestrequirements(repo)
632
633 for d in deficiencies: 631 for d in deficiencies:
634 name = d.name 632 name = d._requirement
635 633
636 # If the action is a requirement that doesn't show up in the 634 # If the action is a requirement that doesn't show up in the
637 # destination requirements, prune the action. 635 # destination requirements, prune the action.
638 if name in knownreqs and name not in destreqs: 636 if name is not None and name not in destreqs:
639 continue 637 continue
640 638
641 newactions.append(d) 639 newactions.append(d)
642 640
643 # FUTURE consider adding some optimizations here for certain transitions. 641 # FUTURE consider adding some optimizations here for certain transitions.