# HG changeset patch # User Marcin Kuzminski # Date 1292688067 -3600 # Node ID 4c123ade8485fed36ebc4ee22f9c59d1ca1fd309 # Parent 3d0661b8aaa481f55ea3ade7d6f9ea09cb671736# Parent 4bdd0bf1b1f4e5fa3f7829d8a33d2fcc8df8dd95 merge with default diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/__init__.py diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/admin/ldap_settings.py --- a/rhodecode/controllers/admin/ldap_settings.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/admin/ldap_settings.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- """ - package.rhodecode.controllers.admin.ldap_settings - ~~~~~~~~~~~~~~ + rhodecode.controllers.admin.ldap_settings + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ldap controller for RhodeCode + :created_on: Nov 26, 2010 :author: marcink :copyright: (C) 2009-2010 Marcin Kuzminski @@ -64,9 +65,7 @@ force_defaults=True,) def ldap_settings(self): - """ - POST ldap create and store ldap settings - """ + """POST ldap create and store ldap settings""" settings_model = SettingsModel() _form = LdapSettingsForm()() @@ -100,7 +99,7 @@ encoding="UTF-8") except Exception: log.error(traceback.format_exc()) - h.flash(_('error occured during update of ldap settings'), + h.flash(_('error occurred during update of ldap settings'), category='error') return redirect(url('ldap_home')) diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/admin/permissions.py --- a/rhodecode/controllers/admin/permissions.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/admin/permissions.py Sat Dec 18 17:01:07 2010 +0100 @@ -120,7 +120,7 @@ encoding="UTF-8") except Exception: log.error(traceback.format_exc()) - h.flash(_('error occured during update of permissions'), + h.flash(_('error occurred during update of permissions'), category='error') return redirect(url('edit_permission', id=id)) diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/admin/repos.py --- a/rhodecode/controllers/admin/repos.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/admin/repos.py Sat Dec 18 17:01:07 2010 +0100 @@ -107,7 +107,7 @@ except Exception: log.error(traceback.format_exc()) - msg = _('error occured during creation of repository %s') \ + msg = _('error occurred during creation of repository %s') \ % form_result.get('repo_name') h.flash(msg, category='error') if request.POST.get('user_created'): @@ -206,7 +206,7 @@ except Exception, e: log.error(traceback.format_exc()) - h.flash(_('An error occured during deletion of %s') % repo_name, + h.flash(_('An error occurred during deletion of %s') % repo_name, category='error') return redirect(url('repos')) @@ -222,7 +222,7 @@ repo_model = RepoModel() repo_model.delete_perm_user(request.POST, repo_name) except Exception, e: - h.flash(_('An error occured during deletion of repository user'), + h.flash(_('An error occurred during deletion of repository user'), category='error') raise HTTPInternalServerError() @@ -237,14 +237,14 @@ repo_model = RepoModel() repo_model.delete_stats(repo_name) except Exception, e: - h.flash(_('An error occured during deletion of repository stats'), + h.flash(_('An error occurred during deletion of repository stats'), category='error') return redirect(url('edit_repo', repo_name=repo_name)) @HasPermissionAllDecorator('hg.admin') def repo_cache(self, repo_name): """ - INVALIDATE exisitings repository cache + INVALIDATE existing repository cache :param repo_name: """ diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/admin/settings.py --- a/rhodecode/controllers/admin/settings.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/admin/settings.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- """ - package.rhodecode.controllers.admin.settings - ~~~~~~~~~~~~~~ + rhodecode.controllers.admin.settings + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + settings controller for rhodecode admin :created_on: Jul 14, 2010 diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/admin/users.py --- a/rhodecode/controllers/admin/users.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/admin/users.py Sat Dec 18 17:01:07 2010 +0100 @@ -87,7 +87,7 @@ encoding="UTF-8") except Exception: log.error(traceback.format_exc()) - h.flash(_('error occured during creation of user %s') \ + h.flash(_('error occurred during creation of user %s') \ % request.POST.get('username'), category='error') return redirect(url('users')) @@ -144,7 +144,7 @@ except (UserOwnsReposException, DefaultUserException), e: h.flash(str(e), category='warning') except Exception: - h.flash(_('An error occured during deletion of user'), + h.flash(_('An error occurred during deletion of user'), category='error') return redirect(url('users')) diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/branches.py --- a/rhodecode/controllers/branches.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/branches.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# branches controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski -# +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.branches + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + branches controller for rhodecode + + :created_on: Apr 21, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -17,31 +24,31 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on April 21, 2010 -branches controller for pylons -@author: marcink -""" + +import logging + from pylons import tmpl_context as c + from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator from rhodecode.lib.base import BaseController, render from rhodecode.lib.utils import OrderedDict from rhodecode.model.scm import ScmModel -import logging + log = logging.getLogger(__name__) class BranchesController(BaseController): - + @LoginRequired() - @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 'repository.admin') + @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', + 'repository.admin') def __before__(self): super(BranchesController, self).__before__() - + def index(self): hg_model = ScmModel() c.repo_info = hg_model.get_repo(c.repo_name) c.repo_branches = OrderedDict() for name, hash_ in c.repo_info.branches.items(): c.repo_branches[name] = c.repo_info.get_changeset(hash_) - + return render('branches/branches.html') diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/changelog.py --- a/rhodecode/controllers/changelog.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/changelog.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# changelog controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski -# +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.changelog + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + changelog controller for rhodecode + + :created_on: Apr 21, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -17,24 +24,24 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on April 21, 2010 -changelog controller for pylons -@author: marcink -""" + +import logging try: import json except ImportError: #python 2.5 compatibility import simplejson as json + from mercurial.graphmod import colored, CHANGESET, revisions as graph_rev from pylons import request, session, tmpl_context as c + from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator from rhodecode.lib.base import BaseController, render from rhodecode.model.scm import ScmModel + from webhelpers.paginate import Page -import logging + log = logging.getLogger(__name__) class ChangelogController(BaseController): diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/error.py --- a/rhodecode/controllers/error.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/error.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - package.rhodecode.controllers.error - ~~~~~~~~~~~~~~ + rhodecode.controllers.error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ RhodeCode error controller diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/feed.py --- a/rhodecode/controllers/feed.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/feed.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# feed controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski - +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.feed + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Feed controller for rhodecode + + :created_on: Apr 23, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -17,21 +24,24 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on April 23, 2010 -feed controller for pylons -@author: marcink -""" -from pylons import tmpl_context as c, url, response -from rhodecode.lib.base import BaseController, render + +import logging + +from pylons import url, response + +from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator +from rhodecode.lib.base import BaseController from rhodecode.model.scm import ScmModel + from webhelpers.feedgenerator import Atom1Feed, Rss201rev2Feed -import logging + log = logging.getLogger(__name__) class FeedController(BaseController): - - #secure it or not ? + + @LoginRequired() + @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', + 'repository.admin') def __before__(self): super(FeedController, self).__before__() #common values for feeds @@ -48,7 +58,7 @@ description=self.description % repo_name, language=self.language, ttl=self.ttl) - + changesets = ScmModel().get_repo(repo_name) for cs in changesets[:self.feed_nr]: @@ -56,11 +66,11 @@ link=url('changeset_home', repo_name=repo_name, revision=cs.raw_id, qualified=True), description=str(cs.date)) - + response.content_type = feed.mime_type return feed.writeString('utf-8') - + def rss(self, repo_name): """Produce an rss2 feed via feedgenerator module""" feed = Rss201rev2Feed(title=self.title % repo_name, @@ -68,13 +78,13 @@ description=self.description % repo_name, language=self.language, ttl=self.ttl) - + changesets = ScmModel().get_repo(repo_name) for cs in changesets[:self.feed_nr]: feed.add_item(title=cs.message, link=url('changeset_home', repo_name=repo_name, revision=cs.raw_id, qualified=True), description=str(cs.date)) - + response.content_type = feed.mime_type return feed.writeString('utf-8') diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/home.py --- a/rhodecode/controllers/home.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/home.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# hg controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski -# +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.home + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Home controller for Rhodecode + + :created_on: Feb 18, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -17,17 +24,16 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on February 18, 2010 -hg controller for pylons -@author: marcink -""" + +import logging from operator import itemgetter + from pylons import tmpl_context as c, request + from rhodecode.lib.auth import LoginRequired from rhodecode.lib.base import BaseController, render from rhodecode.model.scm import ScmModel -import logging + log = logging.getLogger(__name__) class HomeController(BaseController): @@ -51,8 +57,10 @@ sort_key = current_sort_slug + '_sort' if c.sort_by.startswith('-'): - c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), reverse=True) + c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), + reverse=True) else: - c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), reverse=False) + c.repos_list = sorted(cached_repo_list, key=itemgetter(sort_key), + reverse=False) return render('/index.html') diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/journal.py --- a/rhodecode/controllers/journal.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/journal.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# journal controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski -# +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.journal + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Journal controller for pylons + + :created_on: Nov 21, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -17,22 +24,19 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on November 21, 2010 -journal controller for pylons -@author: marcink -""" + +import logging +from sqlalchemy import or_ from pylons import request, response, session, tmpl_context as c, url -from pylons.controllers.util import abort, redirect + from rhodecode.lib.auth import LoginRequired, NotAnonymous from rhodecode.lib.base import BaseController, render from rhodecode.lib.helpers import get_token from rhodecode.model.db import UserLog, UserFollowing from rhodecode.model.scm import ScmModel -from sqlalchemy import or_ -import logging -from paste.httpexceptions import HTTPInternalServerError, HTTPNotFound + +from paste.httpexceptions import HTTPInternalServerError log = logging.getLogger(__name__) diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/login.py --- a/rhodecode/controllers/login.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/login.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# login controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski -# +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.login + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Login controller for rhodeocode + + :created_on: Apr 22, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -18,22 +25,21 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on April 22, 2010 -login controller for pylons -@author: marcink -""" +import logging +import formencode + from formencode import htmlfill + +from pylons.i18n.translation import _ +from pylons.controllers.util import abort, redirect from pylons import request, response, session, tmpl_context as c, url -from pylons.controllers.util import abort, redirect + +import rhodecode.lib.helpers as h from rhodecode.lib.auth import AuthUser, HasPermissionAnyDecorator from rhodecode.lib.base import BaseController, render -import rhodecode.lib.helpers as h -from pylons.i18n.translation import _ from rhodecode.model.forms import LoginForm, RegisterForm, PasswordResetForm from rhodecode.model.user import UserModel -import formencode -import logging + log = logging.getLogger(__name__) diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/search.py --- a/rhodecode/controllers/search.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/search.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# search controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski -# +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.search + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Search controller for rhodecode + + :created_on: Aug 7, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -17,24 +24,23 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on Aug 7, 2010 -search controller for pylons -@author: marcink -""" +import logging +import traceback + +from pylons.i18n.translation import _ from pylons import request, response, config, session, tmpl_context as c, url from pylons.controllers.util import abort, redirect + from rhodecode.lib.auth import LoginRequired from rhodecode.lib.base import BaseController, render from rhodecode.lib.indexers import SCHEMA, IDX_NAME, ResultWrapper + from webhelpers.paginate import Page from webhelpers.util import update_params -from pylons.i18n.translation import _ + from whoosh.index import open_dir, EmptyIndexError from whoosh.qparser import QueryParser, QueryParserError from whoosh.query import Phrase -import logging -import traceback log = logging.getLogger(__name__) @@ -107,7 +113,8 @@ except (EmptyIndexError, IOError): log.error(traceback.format_exc()) log.error('Empty Index data') - c.runtime = _('There is no index to search in. Please run whoosh indexer') + c.runtime = _('There is no index to search in. ' + 'Please run whoosh indexer') # Return a rendered template return render('/search/search.html') diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/settings.py --- a/rhodecode/controllers/settings.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/settings.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# settings controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski -# +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.settings + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Settings controller for rhodecode + + :created_on: Jun 30, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -17,24 +24,23 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on June 30, 2010 -settings controller for pylons -@author: marcink -""" + +import logging +import traceback + +import formencode from formencode import htmlfill + from pylons import tmpl_context as c, request, url from pylons.controllers.util import redirect from pylons.i18n.translation import _ + +import rhodecode.lib.helpers as h from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAllDecorator from rhodecode.lib.base import BaseController, render from rhodecode.lib.utils import invalidate_cache, action_logger from rhodecode.model.forms import RepoSettingsForm, RepoForkForm from rhodecode.model.repo import RepoModel -import formencode -import logging -import rhodecode.lib.helpers as h -import traceback log = logging.getLogger(__name__) @@ -50,7 +56,7 @@ c.repo_info = repo = repo_model.get_by_repo_name(repo_name) if not repo: h.flash(_('%s repository is not mapped to db perhaps' - ' it was created or renamed from the filesystem' + ' it was created or renamed from the file system' ' please run the application again' ' in order to rescan repositories') % repo_name, category='error') @@ -139,7 +145,7 @@ c.repo_info = repo = repo_model.get_by_repo_name(repo_name) if not repo: h.flash(_('%s repository is not mapped to db perhaps' - ' it was created or renamed from the filesystem' + ' it was created or renamed from the file system' ' please run the application again' ' in order to rescan repositories') % repo_name, category='error') diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/shortlog.py --- a/rhodecode/controllers/shortlog.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/shortlog.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# shortlog controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski - +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.shortlog + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Shortlog controller for rhodecode + + :created_on: Apr 18, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -17,27 +24,27 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on April 18, 2010 -shortlog controller for pylons -@author: marcink -""" + +import logging + from pylons import tmpl_context as c, request + +from webhelpers.paginate import Page + from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator from rhodecode.lib.base import BaseController, render from rhodecode.model.scm import ScmModel -from webhelpers.paginate import Page -import logging + log = logging.getLogger(__name__) class ShortlogController(BaseController): - + @LoginRequired() @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', - 'repository.admin') + 'repository.admin') def __before__(self): super(ShortlogController, self).__before__() - + def index(self): p = int(request.params.get('page', 1)) repo = ScmModel().get_repo(c.repo_name) diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/summary.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - package.rhodecode.controllers.summary - ~~~~~~~~~~~~~~ + rhodecode.controllers.summary + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Summary controller for Rhodecode diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/controllers/tags.py --- a/rhodecode/controllers/tags.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/controllers/tags.py Sat Dec 18 17:01:07 2010 +0100 @@ -1,8 +1,15 @@ -#!/usr/bin/env python -# encoding: utf-8 -# tags controller for pylons -# Copyright (C) 2009-2010 Marcin Kuzminski -# +# -*- coding: utf-8 -*- +""" + rhodecode.controllers.tags + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Tags controller for rhodecode + + :created_on: Apr 21, 2010 + :author: marcink + :copyright: (C) 2009-2010 Marcin Kuzminski + :license: GPLv3, see COPYING for more details. +""" # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 @@ -17,31 +24,30 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -""" -Created on April 21, 2010 -tags controller for pylons -@author: marcink -""" +import logging + from pylons import tmpl_context as c + from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator from rhodecode.lib.base import BaseController, render from rhodecode.lib.utils import OrderedDict from rhodecode.model.scm import ScmModel -import logging + log = logging.getLogger(__name__) class TagsController(BaseController): - + @LoginRequired() - @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 'repository.admin') + @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', + 'repository.admin') def __before__(self): super(TagsController, self).__before__() - + def index(self): hg_model = ScmModel() c.repo_info = hg_model.get_repo(c.repo_name) c.repo_tags = OrderedDict() for name, hash_ in c.repo_info.tags.items(): c.repo_tags[name] = c.repo_info.get_changeset(hash_) - + return render('tags/tags.html') diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/lib/helpers.py Sat Dec 18 17:01:07 2010 +0100 @@ -424,7 +424,7 @@ def get_cs_links(): if action == 'push': - revs_limit = 5 + revs_limit = 1000 revs = action_params.split(',') cs_links = " " + ', '.join ([link(rev, url('changeset_home', diff -r 3d0661b8aaa4 -r 4c123ade8485 rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py Sat Dec 18 14:45:58 2010 +0100 +++ b/rhodecode/lib/utils.py Sat Dec 18 17:01:07 2010 +0100 @@ -113,6 +113,7 @@ def get_repos(path, recursive=False, initial=False): """ Scans given path for repos and return (name,(type,path)) tuple + :param prefix: :param path: :param recursive: @@ -137,7 +138,7 @@ def check_repo_fast(repo_name, base_path): """ - Check given path for existance of directory + Check given path for existence of directory :param repo_name: :param base_path: @@ -233,8 +234,8 @@ def set_rhodecode_config(config): - """ - Updates pylons config with new settings from database + """Updates pylons config with new settings from database + :param config: """ from rhodecode.model.settings import SettingsModel @@ -244,10 +245,10 @@ config[k] = v def invalidate_cache(cache_key, *args): - """ - Puts cache invalidation task into db for + """Puts cache invalidation task into db for further global cache invalidation """ + from rhodecode.model.scm import ScmModel if cache_key.startswith('get_repo_cached_'): @@ -269,10 +270,10 @@ @LazyProperty def raw_id(self): - """ - Returns raw string identifying this changeset, useful for web + """Returns raw string identifying this changeset, useful for web representation. """ + return self._empty_cs @LazyProperty @@ -289,8 +290,7 @@ return 0 def repo2db_mapper(initial_repo_list, remove_obsolete=False): - """ - maps all found repositories into db + """maps all found repositories into db """ sa = meta.Session() @@ -443,10 +443,10 @@ beaker.cache.cache_regions[region] = region_settings def get_current_revision(): - """ - Returns tuple of (number, id) from repository containing this package + """Returns tuple of (number, id) from repository containing this package or None if repository could not be found. """ + try: from vcs import get_repo from vcs.utils.helpers import get_scm