# HG changeset patch # User Marcin Kuzminski # Date 2010-10-06 01:22:52 # Node ID b75b77ef649dce2b5fc7a11f9a7860de7b4cab54 # Parent 1e757ac98988d9fcacc77485f0d39c78a6181485 renamed hg_app to rhodecode diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -8,7 +8,7 @@ syntax: regexp syntax: regexp ^\.pydevproject$ syntax: regexp -^hg_app\.db$ +^rhodecode\.db$ syntax: regexp ^test\.db$ syntax: regexp diff --git a/MANIFEST.in b/MANIFEST.in --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,8 +2,8 @@ include COPYING include README.rst include rhodecode/config/deployment.ini_tmpl -include hg_app_daemon -include hg_app_daemon2 +include rhodecode_daemon +include rhodecode_daemon2 recursive-include rhodecode/public/css * recursive-include rhodecode/public/images * diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -94,7 +94,7 @@ logview.pylons.util = #eee ######################################################### ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### ######################################################### -sqlalchemy.db1.url = sqlite:///%(here)s/hg_app.db +sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db #sqlalchemy.db1.echo = False #sqlalchemy.db1.pool_recycle = 3600 sqlalchemy.convert_unicode = true diff --git a/init.d/hg_app_daemon b/init.d/hg_app_daemon --- a/init.d/hg_app_daemon +++ b/init.d/hg_app_daemon @@ -3,7 +3,7 @@ #### THIS IS AN GENTOO INIT.D SCRIPT#### ######################################## -APP_NAME="hg_app" +APP_NAME="rhodecode" APP_HOMEDIR="marcink/python_workspace" APP_PATH="/home/$APP_HOMEDIR/$APP_NAME" diff --git a/init.d/hg_app_daemon2 b/init.d/hg_app_daemon2 --- a/init.d/hg_app_daemon2 +++ b/init.d/hg_app_daemon2 @@ -13,7 +13,7 @@ # Description: starts instance of hg-app using start-stop-daemon ### END INIT INFO -APP_NAME="hg_app" +APP_NAME="rhodecode" APP_HOMEDIR="marcink/python_workspace" APP_PATH="/home/$APP_HOMEDIR/$APP_NAME" diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -94,7 +94,7 @@ logview.pylons.util = #eee ######################################################### ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### ######################################################### -sqlalchemy.db1.url = sqlite:///%(here)s/hg_app.db +sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db #sqlalchemy.db1.echo = False #sqlalchemy.db1.pool_recycle = 3600 sqlalchemy.convert_unicode = true 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 @@ -95,7 +95,7 @@ logview.pylons.util = #eee ######################################################### ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### ######################################################### -sqlalchemy.db1.url = sqlite:///%(here)s/hg_app.db +sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db #sqlalchemy.db1.echo = False #sqlalchemy.db1.pool_recycle = 3600 sqlalchemy.convert_unicode = true diff --git a/rhodecode/config/environment.py b/rhodecode/config/environment.py --- a/rhodecode/config/environment.py +++ b/rhodecode/config/environment.py @@ -4,7 +4,7 @@ from pylons.configuration import PylonsC from pylons.error import handle_mako_error from rhodecode.config.routing import make_map from rhodecode.lib.auth import set_available_permissions, set_base_path -from rhodecode.lib.utils import repo2db_mapper, make_ui, set_hg_app_config +from rhodecode.lib.utils import repo2db_mapper, make_ui, set_rhodecode_config from rhodecode.model import init_model from rhodecode.model.hg_model import _get_repos_cached_initial from sqlalchemy import engine_from_config @@ -72,7 +72,7 @@ def load_environment(global_conf, app_co repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals'], initial)) set_available_permissions(config) set_base_path(config) - set_hg_app_config(config) + set_rhodecode_config(config) # CONFIGURATION OPTIONS HERE (note: all config options will override # any Pylons config options) diff --git a/rhodecode/controllers/admin/repos.py b/rhodecode/controllers/admin/repos.py --- a/rhodecode/controllers/admin/repos.py +++ b/rhodecode/controllers/admin/repos.py @@ -73,16 +73,16 @@ class ReposController(BaseController): form_result = {} try: form_result = _form.to_python(dict(request.POST)) - repo_model.create(form_result, c.hg_app_user) + repo_model.create(form_result, c.rhodecode_user) invalidate_cache('cached_repo_list') h.flash(_('created repository %s') % form_result['repo_name'], category='success') if request.POST.get('user_created'): - action_logger(self.hg_app_user, 'user_created_repo', + action_logger(self.rhodecode_user, 'user_created_repo', form_result['repo_name'], '', self.sa) else: - action_logger(self.hg_app_user, 'admin_created_repo', + action_logger(self.rhodecode_user, 'admin_created_repo', form_result['repo_name'], '', self.sa) except formencode.Invalid as errors: @@ -176,7 +176,7 @@ class ReposController(BaseController): return redirect(url('repos')) try: - action_logger(self.hg_app_user, 'admin_deleted_repo', + action_logger(self.rhodecode_user, 'admin_deleted_repo', repo_name, '', self.sa) repo_model.delete(repo) invalidate_cache('cached_repo_list') 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 @@ -32,7 +32,7 @@ from rhodecode.lib.auth import LoginRequ HasPermissionAnyDecorator from rhodecode.lib.base import BaseController, render from rhodecode.lib.utils import repo2db_mapper, invalidate_cache, \ - set_hg_app_config, get_hg_settings, get_hg_ui_settings, make_ui + set_rhodecode_config, get_hg_settings, get_hg_ui_settings, make_ui from rhodecode.model.db import User, UserLog, HgAppSettings, HgAppUi from rhodecode.model.forms import UserForm, ApplicationSettingsForm, \ ApplicationUiSettingsForm @@ -118,17 +118,17 @@ class SettingsController(BaseController) try: hgsettings1 = self.sa.query(HgAppSettings)\ .filter(HgAppSettings.app_settings_name == 'title').one() - hgsettings1.app_settings_value = form_result['hg_app_title'] + hgsettings1.app_settings_value = form_result['rhodecode_title'] hgsettings2 = self.sa.query(HgAppSettings)\ .filter(HgAppSettings.app_settings_name == 'realm').one() - hgsettings2.app_settings_value = form_result['hg_app_realm'] + hgsettings2.app_settings_value = form_result['rhodecode_realm'] self.sa.add(hgsettings1) self.sa.add(hgsettings2) self.sa.commit() - set_hg_app_config(config) + set_rhodecode_config(config) h.flash(_('Updated application settings'), category='success') @@ -231,7 +231,7 @@ class SettingsController(BaseController) GET /_admin/my_account Displays info about my account """ # url('admin_settings_my_account') - c.user = self.sa.query(User).get(c.hg_app_user.user_id) + c.user = self.sa.query(User).get(c.rhodecode_user.user_id) c.user_repos = [] for repo in c.cached_repo_list.values(): if repo.dbrepo.user.username == c.user.username: @@ -259,9 +259,9 @@ class SettingsController(BaseController) # method='put') # url('admin_settings_my_account_update', id=ID) user_model = UserModel() - uid = c.hg_app_user.user_id + uid = c.rhodecode_user.user_id _form = UserForm(edit=True, old_data={'user_id':uid, - 'email':c.hg_app_user.email})() + 'email':c.rhodecode_user.email})() form_result = {} try: form_result = _form.to_python(dict(request.POST)) @@ -270,7 +270,7 @@ class SettingsController(BaseController) category='success') except formencode.Invalid as errors: - c.user = self.sa.query(User).get(c.hg_app_user.user_id) + c.user = self.sa.query(User).get(c.rhodecode_user.user_id) c.user_repos = [] for repo in c.cached_repo_list.values(): if repo.dbrepo.user.username == c.user.username: diff --git a/rhodecode/controllers/admin/users.py b/rhodecode/controllers/admin/users.py --- a/rhodecode/controllers/admin/users.py +++ b/rhodecode/controllers/admin/users.py @@ -72,7 +72,7 @@ class UsersController(BaseController): user_model.create(form_result) h.flash(_('created user %s') % form_result['username'], category='success') - #action_logger(self.hg_app_user, 'new_user', '', '', self.sa) + #action_logger(self.rhodecode_user, 'new_user', '', '', self.sa) except formencode.Invalid as errors: return htmlfill.render( render('admin/users/user_add.html'), diff --git a/rhodecode/controllers/login.py b/rhodecode/controllers/login.py --- a/rhodecode/controllers/login.py +++ b/rhodecode/controllers/login.py @@ -46,7 +46,7 @@ class LoginController(BaseController): #redirect if already logged in c.came_from = request.GET.get('came_from', None) - if c.hg_app_user.is_authenticated: + if c.rhodecode_user.is_authenticated: return redirect(url('hg_home')) if request.POST: @@ -63,7 +63,7 @@ class LoginController(BaseController): auth_user.user_id = user.user_id auth_user.name = user.name auth_user.lastname = user.lastname - session['hg_app_user'] = auth_user + session['rhodecode_user'] = auth_user session.save() log.info('user %s is now authenticated', username) @@ -138,7 +138,7 @@ class LoginController(BaseController): return render('/password_reset.html') def logout(self): - session['hg_app_user'] = AuthUser() + session['rhodecode_user'] = AuthUser() session.save() log.info('Logging out and setting user as Empty') redirect(url('hg_home')) diff --git a/rhodecode/controllers/settings.py b/rhodecode/controllers/settings.py --- a/rhodecode/controllers/settings.py +++ b/rhodecode/controllers/settings.py @@ -121,7 +121,7 @@ class SettingsController(BaseController) return redirect(url('hg_home')) try: - action_logger(self.hg_app_user, 'user_deleted_repo', + action_logger(self.rhodecode_user, 'user_deleted_repo', repo_name, '', self.sa) repo_model.delete(repo) invalidate_cache('cached_repo_list') @@ -156,11 +156,11 @@ class SettingsController(BaseController) try: form_result = _form.to_python(dict(request.POST)) form_result.update({'repo_name':repo_name}) - repo_model.create_fork(form_result, c.hg_app_user) + repo_model.create_fork(form_result, c.rhodecode_user) h.flash(_('fork %s repository as %s task added') \ % (repo_name, form_result['fork_name']), category='success') - action_logger(self.hg_app_user, 'user_forked_repo', + action_logger(self.rhodecode_user, 'user_forked_repo', repo_name, '', self.sa) except formencode.Invalid as errors: c.new_repo = errors.value['fork_name'] diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py +++ b/rhodecode/controllers/summary.py @@ -54,7 +54,7 @@ class SummaryController(BaseController): uri = u'%(protocol)s://%(user)s@%(host)s%(prefix)s/%(repo_name)s' % { 'protocol': e.get('wsgi.url_scheme'), - 'user':str(c.hg_app_user.username), + 'user':str(c.rhodecode_user.username), 'host':e.get('HTTP_HOST'), 'prefix':e.get('SCRIPT_NAME'), 'repo_name':c.repo_name, } diff --git a/rhodecode/lib/auth.py b/rhodecode/lib/auth.py --- a/rhodecode/lib/auth.py +++ b/rhodecode/lib/auth.py @@ -230,11 +230,11 @@ def get_user(session): Gets user from session, and wraps permissions into user @param session: """ - user = session.get('hg_app_user', AuthUser()) + user = session.get('rhodecode_user', AuthUser()) if user.is_authenticated: user = fill_data(user) user = fill_perms(user) - session['hg_app_user'] = user + session['rhodecode_user'] = user session.save() return user @@ -248,7 +248,7 @@ class LoginRequired(object): return decorator(self.__wrapper, func) def __wrapper(self, func, *fargs, **fkwargs): - user = session.get('hg_app_user', AuthUser()) + user = session.get('rhodecode_user', AuthUser()) log.debug('Checking login required for user:%s', user.username) if user.is_authenticated: log.debug('user %s is authenticated', user.username) @@ -287,7 +287,7 @@ class PermsDecorator(object): # _wrapper.__dict__.update(func.__dict__) # _wrapper.__doc__ = func.__doc__ - self.user_perms = session.get('hg_app_user', AuthUser()).permissions + self.user_perms = session.get('rhodecode_user', AuthUser()).permissions log.debug('checking %s permissions %s for %s', self.__class__.__name__, self.required_perms, func.__name__) @@ -378,7 +378,7 @@ class PermsFunction(object): self.repo_name = None def __call__(self, check_Location=''): - user = session.get('hg_app_user', False) + user = session.get('rhodecode_user', False) if not user: return False self.user_perms = user.permissions diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -15,8 +15,8 @@ from rhodecode.model.hg_model import _ge class BaseController(WSGIController): def __before__(self): - c.hg_app_version = __version__ - c.hg_app_name = config['hg_app_title'] + c.rhodecode_version = __version__ + c.rhodecode_name = config['rhodecode_title'] c.repo_name = get_repo_slug(request) c.cached_repo_list = _get_repos_cached() c.repo_switcher_list = _get_repos_switcher_cached(c.cached_repo_list) @@ -40,7 +40,7 @@ class BaseController(WSGIController): # available in environ['pylons.routes_dict'] try: #putting this here makes sure that we update permissions every time - self.hg_app_user = c.hg_app_user = auth.get_user(session) + self.rhodecode_user = c.rhodecode_user = auth.get_user(session) return WSGIController.__call__(self, environ, start_response) finally: meta.Session.remove() diff --git a/rhodecode/lib/celerylib/tasks.py b/rhodecode/lib/celerylib/tasks.py --- a/rhodecode/lib/celerylib/tasks.py +++ b/rhodecode/lib/celerylib/tasks.py @@ -34,7 +34,7 @@ def get_hg_settings(): raise Exception('Could not get application settings !') settings = {} for each in ret: - settings['hg_app_' + each.app_settings_name] = each.app_settings_value + settings['rhodecode_' + each.app_settings_name] = each.app_settings_value return settings diff --git a/rhodecode/lib/middleware/simplehg.py b/rhodecode/lib/middleware/simplehg.py --- a/rhodecode/lib/middleware/simplehg.py +++ b/rhodecode/lib/middleware/simplehg.py @@ -59,7 +59,7 @@ class SimpleHg(object): #=================================================================== username = REMOTE_USER(environ) if not username: - self.authenticate.realm = self.config['hg_app_realm'] + self.authenticate.realm = self.config['rhodecode_realm'] result = self.authenticate(environ) if isinstance(result, str): AUTH_TYPE.update(environ, 'basic') diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -144,7 +144,7 @@ def get_hg_settings(): raise Exception('Could not get application settings !') settings = {} for each in ret: - settings['hg_app_' + each.app_settings_name] = each.app_settings_value + settings['rhodecode_' + each.app_settings_name] = each.app_settings_value return settings @@ -223,7 +223,7 @@ def make_ui(read_from='file', path=None, return baseui -def set_hg_app_config(config): +def set_rhodecode_config(config): hgsettings = get_hg_settings() for k, v in hgsettings.items(): diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -8,14 +8,14 @@ import logging log = logging.getLogger(__name__) class HgAppSettings(Base): - __tablename__ = 'hg_app_settings' + __tablename__ = 'rhodecode_settings' __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True}) app_settings_id = Column("app_settings_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) app_settings_name = Column("app_settings_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) app_settings_value = Column("app_settings_value", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) class HgAppUi(Base): - __tablename__ = 'hg_app_ui' + __tablename__ = 'rhodecode_ui' __table_args__ = {'useexisting':True} ui_id = Column("ui_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) ui_section = Column("ui_section", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -333,8 +333,8 @@ def ApplicationSettingsForm(): class _ApplicationSettingsForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False - hg_app_title = UnicodeString(strip=True, min=1, not_empty=True) - hg_app_realm = UnicodeString(strip=True, min=1, not_empty=True) + rhodecode_title = UnicodeString(strip=True, min=1, not_empty=True) + rhodecode_realm = UnicodeString(strip=True, min=1, not_empty=True) return _ApplicationSettingsForm 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 @@ -82,19 +82,19 @@
- +
- ${h.text('hg_app_title',size=30)} + ${h.text('rhodecode_title',size=30)}
- +
- ${h.text('hg_app_realm',size=30)} + ${h.text('rhodecode_realm',size=30)}
diff --git a/rhodecode/templates/admin/users/user_edit_my_account.html b/rhodecode/templates/admin/users/user_edit_my_account.html --- a/rhodecode/templates/admin/users/user_edit_my_account.html +++ b/rhodecode/templates/admin/users/user_edit_my_account.html @@ -2,7 +2,7 @@ <%inherit file="/base/base.html"/> <%def name="title()"> - ${c.hg_app_user.username} ${_('account')} + ${c.rhodecode_user.username} ${_('account')} <%def name="breadcrumbs_links()"> diff --git a/rhodecode/templates/base/base.html b/rhodecode/templates/base/base.html --- a/rhodecode/templates/base/base.html +++ b/rhodecode/templates/base/base.html @@ -18,11 +18,11 @@