##// END OF EJS Templates
upgrade: use 'improvement' object for action too...
Pierre-Yves David -
r31903:fa1088de default
parent child Browse files
Show More
@@ -292,7 +292,7 b' def determineactions(repo, deficiencies,'
292 if name in knownreqs and name not in destreqs:
292 if name in knownreqs and name not in destreqs:
293 continue
293 continue
294
294
295 newactions.append(name)
295 newactions.append(d)
296
296
297 # FUTURE consider adding some optimizations here for certain transitions.
297 # FUTURE consider adding some optimizations here for certain transitions.
298 # e.g. adding generaldelta could schedule parent redeltas.
298 # e.g. adding generaldelta could schedule parent redeltas.
@@ -639,11 +639,10 b' def upgraderepo(ui, repo, run=False, opt'
639 'optimizations'))
639 'optimizations'))
640
640
641 deficiencies = finddeficiencies(repo)
641 deficiencies = finddeficiencies(repo)
642 improvements = deficiencies + optimizations
643 actions = determineactions(repo, deficiencies, repo.requirements, newreqs)
642 actions = determineactions(repo, deficiencies, repo.requirements, newreqs)
644 actions.extend(o.name for o in sorted(optimizations)
643 actions.extend(o for o in sorted(optimizations)
645 # determineactions could have added optimisation
644 # determineactions could have added optimisation
646 if o.name not in actions)
645 if o not in actions)
647
646
648 def printrequirements():
647 def printrequirements():
649 ui.write(_('requirements\n'))
648 ui.write(_('requirements\n'))
@@ -661,11 +660,8 b' def upgraderepo(ui, repo, run=False, opt'
661 ui.write('\n')
660 ui.write('\n')
662
661
663 def printupgradeactions():
662 def printupgradeactions():
664 for action in actions:
663 for a in actions:
665 for i in improvements:
664 ui.write('%s\n %s\n\n' % (a.name, a.upgrademessage))
666 if i.name == action:
667 ui.write('%s\n %s\n\n' %
668 (i.name, i.upgrademessage))
669
665
670 if not run:
666 if not run:
671 fromdefault = []
667 fromdefault = []
@@ -705,8 +701,8 b' def upgraderepo(ui, repo, run=False, opt'
705 printrequirements()
701 printrequirements()
706 printupgradeactions()
702 printupgradeactions()
707
703
708 unusedoptimize = [i for i in alloptimizations
704 unusedoptimize = [i for i in alloptimizations if i not in actions]
709 if i.name not in actions]
705
710 if unusedoptimize:
706 if unusedoptimize:
711 ui.write(_('additional optimizations are available by specifying '
707 ui.write(_('additional optimizations are available by specifying '
712 '"--optimize <name>":\n\n'))
708 '"--optimize <name>":\n\n'))
@@ -719,6 +715,8 b' def upgraderepo(ui, repo, run=False, opt'
719 printrequirements()
715 printrequirements()
720 printupgradeactions()
716 printupgradeactions()
721
717
718 upgradeactions = [a.name for a in actions]
719
722 ui.write(_('beginning upgrade...\n'))
720 ui.write(_('beginning upgrade...\n'))
723 with repo.wlock():
721 with repo.wlock():
724 with repo.lock():
722 with repo.lock():
@@ -740,7 +738,7 b' def upgraderepo(ui, repo, run=False, opt'
740 with dstrepo.wlock():
738 with dstrepo.wlock():
741 with dstrepo.lock():
739 with dstrepo.lock():
742 backuppath = _upgraderepo(ui, repo, dstrepo, newreqs,
740 backuppath = _upgraderepo(ui, repo, dstrepo, newreqs,
743 actions)
741 upgradeactions)
744
742
745 finally:
743 finally:
746 ui.write(_('removing temporary repository %s\n') % tmppath)
744 ui.write(_('removing temporary repository %s\n') % tmppath)
General Comments 0
You need to be logged in to leave comments. Login now