diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -212,6 +212,7 @@ auth_ret_code = ## codes don't break the transactions while 4XX codes do lock_ret_code = 423 +allow_repo_location_change = True #################################### ### CELERY CONFIG #### diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -212,6 +212,7 @@ auth_ret_code = ## codes don't break the transactions while 4XX codes do lock_ret_code = 423 +allow_repo_location_change = True #################################### ### CELERY CONFIG #### diff --git a/rhodecode/config/deployment.ini_tmpl b/rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl +++ b/rhodecode/config/deployment.ini_tmpl @@ -212,6 +212,7 @@ auth_ret_code = ## codes don't break the transactions while 4XX codes do lock_ret_code = 423 +allow_repo_location_change = True #################################### ### CELERY CONFIG #### diff --git a/rhodecode/controllers/admin/settings.py b/rhodecode/controllers/admin/settings.py --- a/rhodecode/controllers/admin/settings.py +++ b/rhodecode/controllers/admin/settings.py @@ -242,10 +242,10 @@ class SettingsController(BaseController) sett = RhodeCodeUi.get_by_key('push_ssl') sett.ui_value = form_result['web_push_ssl'] Session().add(sett) - - sett = RhodeCodeUi.get_by_key('/') - sett.ui_value = form_result['paths_root_path'] - Session().add(sett) + if c.visual.allow_repo_location_change: + sett = RhodeCodeUi.get_by_key('/') + sett.ui_value = form_result['paths_root_path'] + Session().add(sett) #HOOKS sett = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_UPDATE) diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -277,6 +277,7 @@ class BaseController(WSGIController): ## INI stored self.cut_off_limit = int(config.get('cut_off_limit')) + c.visual.allow_repo_location_change = str2bool(config.get('allow_repo_location_change', True)) c.repo_name = get_repo_slug(request) # can be empty c.backends = BACKENDS.keys() diff --git a/rhodecode/templates/admin/settings/settings.html b/rhodecode/templates/admin/settings/settings.html --- a/rhodecode/templates/admin/settings/settings.html +++ b/rhodecode/templates/admin/settings/settings.html @@ -268,20 +268,21 @@ ##${_('Requires hg-git library installed. Allows cloning from git remote locations')} + %if c.visual.allow_repo_location_change: