comparison mercurial/upgrade.py @ 31870:49011f1cedd4

upgrade: drop the prefix to the 'supporteddestrequirements' function Now that we are in the 'upgrade' module we can simplify the name.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 10 Apr 2017 18:04:50 +0200
parents fe5e30b58934
children 5881f76323c2
comparison
equal deleted inserted replaced
31869:fe5e30b58934 31870:49011f1cedd4
60 the dropped requirement must appear in the returned set for the upgrade 60 the dropped requirement must appear in the returned set for the upgrade
61 to be allowed. 61 to be allowed.
62 """ 62 """
63 return set() 63 return set()
64 64
65 def upgradesupporteddestrequirements(repo): 65 def supporteddestrequirements(repo):
66 """Obtain requirements that upgrade supports in the destination. 66 """Obtain requirements that upgrade supports in the destination.
67 67
68 If the result of the upgrade would create requirements not in this set, 68 If the result of the upgrade would create requirements not in this set,
69 the upgrade is disallowed. 69 the upgrade is disallowed.
70 70
278 278
279 Returns a list of action names. 279 Returns a list of action names.
280 """ 280 """
281 newactions = [] 281 newactions = []
282 282
283 knownreqs = upgradesupporteddestrequirements(repo) 283 knownreqs = supporteddestrequirements(repo)
284 284
285 for i in improvements: 285 for i in improvements:
286 name = i.name 286 name = i.name
287 287
288 # If the action is a requirement that doesn't show up in the 288 # If the action is a requirement that doesn't show up in the
617 if noaddreqs: 617 if noaddreqs:
618 raise error.Abort(_('cannot upgrade repository; do not support adding ' 618 raise error.Abort(_('cannot upgrade repository; do not support adding '
619 'requirement: %s') % 619 'requirement: %s') %
620 _(', ').join(sorted(noaddreqs))) 620 _(', ').join(sorted(noaddreqs)))
621 621
622 unsupportedreqs = newreqs - upgradesupporteddestrequirements(repo) 622 unsupportedreqs = newreqs - supporteddestrequirements(repo)
623 if unsupportedreqs: 623 if unsupportedreqs:
624 raise error.Abort(_('cannot upgrade repository; do not support ' 624 raise error.Abort(_('cannot upgrade repository; do not support '
625 'destination requirement: %s') % 625 'destination requirement: %s') %
626 _(', ').join(sorted(unsupportedreqs))) 626 _(', ').join(sorted(unsupportedreqs)))
627 627