Changeset - 7676606f7622
[Not reviewed]
default
0 2 0
Grzegorz Rożniecki - 12 years ago 2013-07-17 09:19:10
xaerxess@gmail.com
Transplanted from: 9740dcdeaea0
Added more detailed (and localized) information if hgsubversion is not
installed while enabling from settings
2 files changed with 16 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -41,6 +41,7 @@ from rhodecode.lib.auth import LoginRequ
 
    HasReposGroupPermissionAll, HasReposGroupPermissionAny, AuthUser
 
from rhodecode.lib.base import BaseController, render
 
from rhodecode.lib.celerylib import tasks, run_task
 
from rhodecode.lib.exceptions import HgsubversionImportError
 
from rhodecode.lib.utils import repo2db_mapper, set_rhodecode_config, \
 
    check_git_version
 
from rhodecode.model.db import RhodeCodeUi, Repository, RepoGroup, \
 
@@ -287,6 +288,11 @@ class SettingsController(BaseController)
 
                    sett.ui_section = 'extensions'
 

	
 
                sett.ui_active = form_result['extensions_hgsubversion']
 
                if sett.ui_active:
 
                    try:
 
                        import hgsubversion
 
                    except ImportError:
 
                        raise HgsubversionImportError
 
                Session().add(sett)
 

	
 
#                sett = RhodeCodeUi.get_by_key('hggit')
 
@@ -303,6 +309,12 @@ class SettingsController(BaseController)
 

	
 
                h.flash(_('Updated VCS settings'), category='success')
 

	
 
            except HgsubversionImportError:
 
                log.error(traceback.format_exc())
 
                h.flash(_('Unable to activate hgsubversion support. '
 
                          'The "hgsubversion" library is missing'),
 
                        category='error')
 

	
 
            except Exception:
 
                log.error(traceback.format_exc())
 
                h.flash(_('Error occurred during updating '
rhodecode/lib/exceptions.py
Show inline comments
 
@@ -98,3 +98,7 @@ class UserCreationError(Exception):
 

	
 
class RepositoryCreationError(Exception):
 
    pass
 

	
 

	
 
class HgsubversionImportError(Exception):
 
    pass
0 comments (0 inline, 0 general)