# HG changeset patch # User Marcin Kuzminski # Date 1369922894 -7200 # Node ID 985db7f7b9b25388c4b4056d7001e1bc2d2322d7 # Parent b367b016ee39a1168d553c73e585b960d23a8db0 Added flag to controll option for changing the repos path location from web interface diff -r b367b016ee39 -r 985db7f7b9b2 development.ini --- a/development.ini Thu May 30 14:12:32 2013 +0200 +++ b/development.ini Thu May 30 16:08:14 2013 +0200 @@ -212,6 +212,7 @@ ## codes don't break the transactions while 4XX codes do lock_ret_code = 423 +allow_repo_location_change = True #################################### ### CELERY CONFIG #### diff -r b367b016ee39 -r 985db7f7b9b2 production.ini --- a/production.ini Thu May 30 14:12:32 2013 +0200 +++ b/production.ini Thu May 30 16:08:14 2013 +0200 @@ -212,6 +212,7 @@ ## codes don't break the transactions while 4XX codes do lock_ret_code = 423 +allow_repo_location_change = True #################################### ### CELERY CONFIG #### diff -r b367b016ee39 -r 985db7f7b9b2 rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl Thu May 30 14:12:32 2013 +0200 +++ b/rhodecode/config/deployment.ini_tmpl Thu May 30 16:08:14 2013 +0200 @@ -212,6 +212,7 @@ ## codes don't break the transactions while 4XX codes do lock_ret_code = 423 +allow_repo_location_change = True #################################### ### CELERY CONFIG #### diff -r b367b016ee39 -r 985db7f7b9b2 rhodecode/controllers/admin/settings.py --- a/rhodecode/controllers/admin/settings.py Thu May 30 14:12:32 2013 +0200 +++ b/rhodecode/controllers/admin/settings.py Thu May 30 16:08:14 2013 +0200 @@ -242,10 +242,10 @@ 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 -r b367b016ee39 -r 985db7f7b9b2 rhodecode/lib/base.py --- a/rhodecode/lib/base.py Thu May 30 14:12:32 2013 +0200 +++ b/rhodecode/lib/base.py Thu May 30 16:08:14 2013 +0200 @@ -277,6 +277,7 @@ ## 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 -r b367b016ee39 -r 985db7f7b9b2 rhodecode/templates/admin/settings/settings.html --- a/rhodecode/templates/admin/settings/settings.html Thu May 30 14:12:32 2013 +0200 +++ b/rhodecode/templates/admin/settings/settings.html Thu May 30 16:08:14 2013 +0200 @@ -268,20 +268,21 @@ ##${_('Requires hg-git library installed. Allows cloning from git remote locations')} + %if c.visual.allow_repo_location_change:
- ${h.text('paths_root_path',size=30,readonly="readonly")} - + ${h.text('paths_root_path',size=30,readonly="readonly", class_="disabled")} + ${_('Unlock')} ${_('Location where repositories are stored. After changing this value a restart, and rescan is required')}
- + %endif
${h.submit('save',_('Save settings'),class_="ui-btn large")} ${h.reset('reset',_('Reset'),class_="ui-btn large")} @@ -292,8 +293,9 @@