diff --git a/README.rst b/README.rst --- a/README.rst +++ b/README.rst @@ -1,33 +1,33 @@ --------------------------------------------------------------- -Pylons based repository management for mercurial (and soon git) --------------------------------------------------------------- - -Fully customizable, with authentication, permissions. Based on vcs library. +------------------------------------------------ +Pylons based repository management for mercurial +------------------------------------------------ **Overview** -- has it's own middleware to handle mercurial protocol request each request can - be logged and authenticated + threaded performance unlikely to hgweb -- full permissions per project read/write/admin access even on mercurial request -- mako templates let's you customize look and feel of application. -- diffs annotations and source code all colored by pygments. -- mercurial branch graph and yui-flot powered graphs with zooming and statistics -- admin interface for performing user/permission managements as well as repository - management. -- server side forks, it's possible to fork a project and hack it free without +- Has it's own middleware to handle mercurial protocol request. Each request can + be logged and authenticated. Runs on threads unlikely to hgweb You can make + multiple pulls/pushes simultaneous +- Full permissions and authentication per project private/read/write/admin. + One account for web interface and mercurial push/pull/clone. +- Mako templates let's you customize look and feel of application. +- Beautiful diffs, annotations and source codes all colored by pygments. +- Mercurial branch graph and yui-flot powered graphs with zooming and statistics +- Admin interface with user/permission management. User activity journal logs + pulls, pushes, forks,registrations. Possible to disable built in hooks +- Server side forks, it's possible to fork a project and hack it free without breaking the main. -- full text search of source codes with indexing daemons using whoosh +- Full text search on source codes, search on file names. All powered by whoosh + and build in indexing daemons (no external search servers required all in one application) -- async tasks for speed and performance using celery (works without them too) -- Additional settings for mercurial web, (hooks editable from admin - panel !) also manage paths, archive, remote messages -- backup scripts can do backup of whole app and send it over scp to desired location -- setup project descriptions and info inside built in db for easy, non +- Rss / atom feeds, gravatar support, download sources as zip/tarballs +- Async tasks for speed and performance using celery (works without them too) +- Backup scripts can do backup of whole app and send it over scp to desired + location +- Setup project descriptions and info inside built in db for easy, non file-system operations -- added cache with invalidation on push/repo management for high performance and +- Added cache with invalidation on push/repo management for high performance and always up to date data. -- rss / atom feeds, gravatar support -- based on pylons 1.0 / sqlalchemy 0.6 +- Based on pylons 1.0 / sqlalchemy 0.6 / sqlite **Incoming** @@ -36,19 +36,14 @@ Fully customizable, with authentication, - commit based wikis - clonning from remote repositories into rhodecode (git/mercurial) - other cools stuff that i can figure out (or You can help me figure out) - -.. note:: - This software is still in beta mode. - I don't guarantee that it'll work correctly. +------------ +Installation +------------ -------------- -Installation -------------- - -quick setup +**quick setup** -- pip install -E rhodecode-venv http://bitbucket.org/marcinkuzminski/rhodecode/get/tip.zip +- pip install -E rhodecode-venv rhodecode - activate virtualenv - run `paster make-config RhodeCode production.ini` - run `paster setup-app production.ini` @@ -56,8 +51,7 @@ quick setup You're ready to go. - -MORE DETAILED INSTRUCTIONS +**MORE DETAILED INSTRUCTIONS** - I highly recommend to install new virtualenv for rhodecode see http://pypi.python.org/pypi/virtualenv for more details. @@ -66,7 +60,7 @@ MORE DETAILED INSTRUCTIONS Activate the virtualenv by running `source activate /var/www/rhodecode-venv/bin/activate` - Make a folder for rhodecode somewhere on the filesystem for example /var/www/rhodecode -- Run easy_install http://bitbucket.org/marcinkuzminski/rhodecode/get/tip.zip. +- Run easy_install rhodecode - Run `paster make-config RhodeCode production.inii` in order to install the application config. You can play with the app settings later - Run `paster setup-app production.ini` it should create all needed tables @@ -83,12 +77,11 @@ MORE DETAILED INSTRUCTIONS The app should gain a lot of speed and become much more responsible. For installation instructions You can visit: http://ask.github.com/celery/getting-started/index.html. -- All needed configs are inside rhodecode ie. celeryconfig.py , production.ini - You can configure the email, ports, loggers, workers from there. +- All needed configs are inside rhodecode sources ie. celeryconfig.py, + development.ini, production.ini You can configure the email, ports, loggers, + workers from there. - For full text search You can either put crontab entry for `python /var/www/rhodecode/rhodecode/lib/indexers/daemon.py incremental ` or run indexer from admin panel. This will scann the repos given in the application setup or given path for daemon.py and each scann in incremental - mode will scann only changed files, - Hg Update hook must be activated to index the content it's enabled by default - after setup \ No newline at end of file + mode will scann only changed files. \ No newline at end of file diff --git a/rhodecode/controllers/admin/permissions.py b/rhodecode/controllers/admin/permissions.py --- a/rhodecode/controllers/admin/permissions.py +++ b/rhodecode/controllers/admin/permissions.py @@ -102,7 +102,7 @@ class PermissionsController(BaseControll h.flash(_('Default permissions updated succesfully'), category='success') - except formencode.Invalid as errors: + except formencode.Invalid, errors: c.perms_choices = self.perms_choices c.register_choices = self.register_choices c.create_choices = self.create_choices 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 @@ -79,13 +79,13 @@ class ReposController(BaseController): category='success') if request.POST.get('user_created'): - action_logger(self.rhodecode_user, 'user_created_repo', + action_logger(self.rhodecode_user, 'user_created_repo', form_result['repo_name'], '', self.sa) else: - action_logger(self.rhodecode_user, 'admin_created_repo', + action_logger(self.rhodecode_user, 'admin_created_repo', form_result['repo_name'], '', self.sa) - except formencode.Invalid as errors: + except formencode.Invalid, errors: c.new_repo = errors.value['repo_name'] if request.POST.get('user_created'): @@ -137,7 +137,7 @@ class ReposController(BaseController): h.flash(_('Repository %s updated succesfully' % repo_name), category='success') changed_name = form_result['repo_name'] - except formencode.Invalid as errors: + except formencode.Invalid, errors: c.repo_info = repo_model.get(repo_name) c.users_array = repo_model.get_users_js() errors.value.update({'user':c.repo_info.user.username}) @@ -176,7 +176,7 @@ class ReposController(BaseController): return redirect(url('repos')) try: - action_logger(self.rhodecode_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') @@ -199,7 +199,7 @@ class ReposController(BaseController): try: repo_model = RepoModel() repo_model.delete_perm_user(request.POST, repo_name) - except Exception as e: + except Exception, e: h.flash(_('An error occured during deletion of repository user'), category='error') raise HTTPInternalServerError() 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 @@ -140,7 +140,7 @@ class SettingsController(BaseController) self.sa.rollback() - except formencode.Invalid as errors: + except formencode.Invalid, errors: return htmlfill.render( render('admin/settings/settings.html'), defaults=errors.value, @@ -193,7 +193,7 @@ class SettingsController(BaseController) self.sa.rollback() - except formencode.Invalid as errors: + except formencode.Invalid, errors: return htmlfill.render( render('admin/settings/settings.html'), defaults=errors.value, @@ -269,7 +269,7 @@ class SettingsController(BaseController) h.flash(_('Your account was updated succesfully'), category='success') - except formencode.Invalid as errors: + except formencode.Invalid, errors: c.user = self.sa.query(User).get(c.rhodecode_user.user_id) c.user_repos = [] for repo in c.cached_repo_list.values(): 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 @@ -73,7 +73,7 @@ class UsersController(BaseController): h.flash(_('created user %s') % form_result['username'], category='success') #action_logger(self.rhodecode_user, 'new_user', '', '', self.sa) - except formencode.Invalid as errors: + except formencode.Invalid, errors: return htmlfill.render( render('admin/users/user_add.html'), defaults=errors.value, @@ -110,7 +110,7 @@ class UsersController(BaseController): user_model.update(id, form_result) h.flash(_('User updated succesfully'), category='success') - except formencode.Invalid as errors: + except formencode.Invalid, errors: return htmlfill.render( render('admin/users/user_edit.html'), defaults=errors.value, @@ -136,7 +136,7 @@ class UsersController(BaseController): try: user_model.delete(id) h.flash(_('sucessfully deleted user'), category='success') - except DefaultUserException as e: + except DefaultUserException, e: h.flash(str(e), category='warning') except Exception: h.flash(_('An error occured during deletion of user'), diff --git a/rhodecode/controllers/login.py b/rhodecode/controllers/login.py --- a/rhodecode/controllers/login.py +++ b/rhodecode/controllers/login.py @@ -74,7 +74,7 @@ class LoginController(BaseController): else: return redirect(url('hg_home')) - except formencode.Invalid as errors: + except formencode.Invalid, errors: return htmlfill.render( render('/login.html'), defaults=errors.value, @@ -105,7 +105,7 @@ class LoginController(BaseController): category='success') return redirect(url('login_home')) - except formencode.Invalid as errors: + except formencode.Invalid, errors: return htmlfill.render( render('/register.html'), defaults=errors.value, @@ -127,7 +127,7 @@ class LoginController(BaseController): category='success') return redirect(url('login_home')) - except formencode.Invalid as errors: + except formencode.Invalid, errors: return htmlfill.render( render('/password_reset.html'), defaults=errors.value, diff --git a/rhodecode/controllers/settings.py b/rhodecode/controllers/settings.py --- a/rhodecode/controllers/settings.py +++ b/rhodecode/controllers/settings.py @@ -82,7 +82,7 @@ class SettingsController(BaseController) h.flash(_('Repository %s updated successfully' % repo_name), category='success') changed_name = form_result['repo_name'] - except formencode.Invalid as errors: + except formencode.Invalid, errors: c.repo_info = repo_model.get(repo_name) c.users_array = repo_model.get_users_js() errors.value.update({'user':c.repo_info.user.username}) @@ -121,7 +121,7 @@ class SettingsController(BaseController) return redirect(url('hg_home')) try: - action_logger(self.rhodecode_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') @@ -162,7 +162,7 @@ class SettingsController(BaseController) category='success') action_logger(self.rhodecode_user, 'user_forked_repo', repo_name, '', self.sa) - except formencode.Invalid as errors: + except formencode.Invalid, errors: c.new_repo = errors.value['fork_name'] r = render('settings/repo_fork.html') diff --git a/rhodecode/lib/auth.py b/rhodecode/lib/auth.py --- a/rhodecode/lib/auth.py +++ b/rhodecode/lib/auth.py @@ -85,7 +85,7 @@ def get_user_cached(username): def authfunc(environ, username, password): try: user = get_user_cached(username) - except (NoResultFound, MultipleResultsFound, OperationalError) as e: + except (NoResultFound, MultipleResultsFound, OperationalError), e: log.error(e) user = None 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 @@ -8,10 +8,15 @@ from rhodecode.lib.smtp_mailer import Sm from rhodecode.lib.utils import OrderedDict from time import mktime from vcs.backends.hg import MercurialRepository -import json import traceback try: + import json +except ImportError: + #python 2.5 compatibility + import simplejson as json + +try: from celeryconfig import PYLONS_CONFIG as config celery_on = True except ImportError: diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ from rhodecode import get_version import sys +py_version = sys.version_info requirements = [ "Pylons>=1.0.0", @@ -9,12 +10,15 @@ requirements = [ "vcs>=0.1.7", "pygments>=1.3.0", "mercurial>=1.6", - "pysqlite", "whoosh==1.0.0", "py-bcrypt", "celery", ] +if sys.version_info < (2, 6): + requirements.append("simplejson") + requirements.append("pysqlite") + #additional files from project that goes somewhere in the filesystem #relative to sys.prefix data_files = []