662 given, upgrade them all. |
662 given, upgrade them all. |
663 """ |
663 """ |
664 name = 'upgrade' |
664 name = 'upgrade' |
665 actionverb = 'upgraded' |
665 actionverb = 'upgraded' |
666 options = InstanceCommand.options + ( |
666 options = InstanceCommand.options + ( |
667 ('force-componant-version', |
667 ('force-cube-version', |
668 {'short': 't', 'type' : 'csv', 'metavar': 'cube1=X.Y.Z,cube2=X.Y.Z', |
668 {'short': 't', 'type' : 'named', 'metavar': 'cube1:X.Y.Z,cube2:X.Y.Z', |
669 'default': None, |
669 'default': None, |
670 'help': 'force migration from the indicated version for the specified cube.'}), |
670 'help': 'force migration from the indicated version for the specified cube(s).'}), |
|
671 |
671 ('force-cubicweb-version', |
672 ('force-cubicweb-version', |
672 {'short': 'e', 'type' : 'string', 'metavar': 'X.Y.Z', |
673 {'short': 'e', 'type' : 'string', 'metavar': 'X.Y.Z', |
673 'default': None, |
674 'default': None, |
674 'help': 'force migration from the indicated cubicweb version.'}), |
675 'help': 'force migration from the indicated cubicweb version.'}), |
675 |
676 |
719 pass |
720 pass |
720 # get instance and installed versions for the server and the componants |
721 # get instance and installed versions for the server and the componants |
721 mih = config.migration_handler() |
722 mih = config.migration_handler() |
722 repo = mih.repo_connect() |
723 repo = mih.repo_connect() |
723 vcconf = repo.get_versions() |
724 vcconf = repo.get_versions() |
724 if self.config.force_componant_version: |
725 if self.config.force_cube_version: |
725 packversions = {} |
726 for cube, version in self.config.force_cube_version.iteritems(): |
726 for vdef in self.config.force_componant_version: |
727 vcconf[cube] = Version(version) |
727 componant, version = vdef.split('=') |
|
728 packversions[componant] = Version(version) |
|
729 vcconf.update(packversions) |
|
730 toupgrade = [] |
728 toupgrade = [] |
731 for cube in config.cubes(): |
729 for cube in config.cubes(): |
732 installedversion = config.cube_version(cube) |
730 installedversion = config.cube_version(cube) |
733 try: |
731 try: |
734 applversion = vcconf[cube] |
732 applversion = vcconf[cube] |