Changeset - dde0ef0d886f
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 14 years ago 2011-12-17 20:47:08
marcin@python-works.com
fixes #324 proper largefiles extension enable
1 file changed with 20 insertions and 14 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/db_manage.py
Show inline comments
 
@@ -60,7 +60,8 @@ class DbManage(object):
 
        self.sa = meta.Session
 

	
 
    def create_tables(self, override=False):
 
        """Create a auth database
 
        """
 
        Create a auth database
 
        """
 

	
 
        log.info("Any existing database is going to be destroyed")
 
@@ -86,7 +87,8 @@ class DbManage(object):
 
        log.info('db version set to: %s', __dbversion__)
 

	
 
    def upgrade(self):
 
        """Upgrades given database schema to given revision following
 
        """
 
        Upgrades given database schema to given revision following
 
        all needed steps, to perform the upgrade
 

	
 
        """
 
@@ -125,7 +127,8 @@ class DbManage(object):
 
        # UPGRADE STEPS
 
        #======================================================================
 
        class UpgradeSteps(object):
 
            """Those steps follow schema versions so for example schema
 
            """
 
            Those steps follow schema versions so for example schema
 
            for example schema with seq 002 == step_2 and so on.
 
            """
 

	
 
@@ -166,7 +169,8 @@ class DbManage(object):
 
            getattr(UpgradeSteps(self), 'step_%s' % step)()
 

	
 
    def fix_repo_paths(self):
 
        """Fixes a old rhodecode version path into new one without a '*'
 
        """
 
        Fixes a old rhodecode version path into new one without a '*'
 
        """
 

	
 
        paths = self.sa.query(RhodeCodeUi)\
 
@@ -183,7 +187,8 @@ class DbManage(object):
 
            raise
 

	
 
    def fix_default_user(self):
 
        """Fixes a old default user with some 'nicer' default values,
 
        """
 
        Fixes a old default user with some 'nicer' default values,
 
        used mostly for anonymous access
 
        """
 
        def_user = self.sa.query(User)\
 
@@ -202,7 +207,8 @@ class DbManage(object):
 
            raise
 

	
 
    def fix_settings(self):
 
        """Fixes rhodecode settings adds ga_code key for google analytics
 
        """
 
        Fixes rhodecode settings adds ga_code key for google analytics
 
        """
 

	
 
        hgsettings3 = RhodeCodeSetting('ga_code', '')
 
@@ -246,10 +252,10 @@ class DbManage(object):
 
        else:
 
            log.info('creating admin and regular test users')
 
            from rhodecode.tests import TEST_USER_ADMIN_LOGIN,\
 
            TEST_USER_ADMIN_PASS ,TEST_USER_ADMIN_EMAIL,TEST_USER_REGULAR_LOGIN,\
 
            TEST_USER_REGULAR_PASS,TEST_USER_REGULAR_EMAIL,\
 
            TEST_USER_REGULAR2_LOGIN,TEST_USER_REGULAR2_PASS,\
 
            TEST_USER_REGULAR2_EMAIL
 
            TEST_USER_ADMIN_PASS, TEST_USER_ADMIN_EMAIL,\
 
            TEST_USER_REGULAR_LOGIN, TEST_USER_REGULAR_PASS,\
 
            TEST_USER_REGULAR_EMAIL, TEST_USER_REGULAR2_LOGIN, \
 
            TEST_USER_REGULAR2_PASS, TEST_USER_REGULAR2_EMAIL
 

	
 
            self.create_user(TEST_USER_ADMIN_LOGIN, TEST_USER_ADMIN_PASS,
 
                             TEST_USER_ADMIN_EMAIL, True)
 
@@ -261,10 +267,11 @@ class DbManage(object):
 
                             TEST_USER_REGULAR2_EMAIL, False)
 

	
 
    def create_ui_settings(self):
 
        """Creates ui settings, fills out hooks
 
        """
 
        Creates ui settings, fills out hooks
 
        and disables dotencode
 
        """
 

	
 
        """
 
        #HOOKS
 
        hooks1_key = RhodeCodeUi.HOOK_UPDATE
 
        hooks1_ = self.sa.query(RhodeCodeUi)\
 
@@ -305,7 +312,7 @@ class DbManage(object):
 
        largefiles = RhodeCodeUi()
 
        largefiles.ui_section = 'extensions'
 
        largefiles.ui_key = 'largefiles'
 
        largefiles.ui_value = '1'
 
        largefiles.ui_value = ''
 

	
 
        self.sa.add(hooks1)
 
        self.sa.add(hooks2)
 
@@ -351,7 +358,6 @@ class DbManage(object):
 
            path_ok = False
 
            log.error('No write permission to given path %s', path)
 

	
 

	
 
        if retries == 0:
 
            sys.exit('max retries reached')
 
        if path_ok is False:
0 comments (0 inline, 0 general)