Show More
@@ -32,8 +32,8 b' from rhodecode.model.db import Repositor' | |||||
32 | from rhodecode.model.repo import RepoModel |
|
32 | from rhodecode.model.repo import RepoModel | |
33 | from rhodecode.model.user import UserModel |
|
33 | from rhodecode.model.user import UserModel | |
34 | from vcs.backends.base import BaseChangeset |
|
34 | from vcs.backends.base import BaseChangeset | |
35 | from vcs.backends.git import GitRepository |
|
35 | from paste.script import command | |
36 | from vcs.backends.hg import MercurialRepository |
|
36 | import ConfigParser | |
37 | from vcs.utils.lazy import LazyProperty |
|
37 | from vcs.utils.lazy import LazyProperty | |
38 | import traceback |
|
38 | import traceback | |
39 | import datetime |
|
39 | import datetime | |
@@ -517,3 +517,28 b' def create_test_env(repos_test_path, con' | |||||
517 | tar = tarfile.open(jn(cur_dir, 'tests', "vcs_test.tar.gz")) |
|
517 | tar = tarfile.open(jn(cur_dir, 'tests', "vcs_test.tar.gz")) | |
518 | tar.extractall('/tmp') |
|
518 | tar.extractall('/tmp') | |
519 | tar.close() |
|
519 | tar.close() | |
|
520 | ||||
|
521 | class UpgradeDb(command.Command): | |||
|
522 | """Command used for paster to upgrade our database to newer version | |||
|
523 | """ | |||
|
524 | ||||
|
525 | max_args = 1 | |||
|
526 | min_args = 1 | |||
|
527 | ||||
|
528 | usage = "CONFIG_FILE" | |||
|
529 | summary = "Upgrades current db to newer version given configuration file" | |||
|
530 | group_name = "RhodeCode" | |||
|
531 | ||||
|
532 | parser = command.Command.standard_parser(verbose=True) | |||
|
533 | ||||
|
534 | parser.add_option('--sql', | |||
|
535 | action='store_true', | |||
|
536 | dest='just_sql', | |||
|
537 | help="Prints upgrade sql for further investigation", | |||
|
538 | default=False) | |||
|
539 | def command(self): | |||
|
540 | config_name = self.args[0] | |||
|
541 | p = config_name.split('/') | |||
|
542 | root = '.' if len(p) == 1 else '/'.join(p[:-1]) | |||
|
543 | config = ConfigParser.ConfigParser({'here':root}) | |||
|
544 | config.read(config_name) |
General Comments 0
You need to be logged in to leave comments.
Login now