Skip to content

Commit

Permalink
merges for upcoming release
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinkuzminski committed Apr 5, 2011
1 parent b21e624 commit dfba4af
Show file tree
Hide file tree
Showing 7 changed files with 770 additions and 406 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTORS
@@ -0,0 +1,6 @@
List of contributors to RhodeCode project:
Marcin Kuźmiński <marcin@python-works.com>
Lukasz Balcerzak <lukaszbalcerzak@gmail.com>
Jason Harris <jason@jasonfharris.com>
Thayne Harbaugh <thayne@fusionio.com>
cejones
910 changes: 622 additions & 288 deletions COPYING

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions rhodecode/__init__.py
Expand Up @@ -8,29 +8,28 @@
:created_on: Apr 9, 2010
:author: marcink
:copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com>
:copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com>
: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
# of the License or (at your opinion) any later version of the license.
#
# 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, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import platform

VERSION = (1, 1, 7)
VERSION = (1, 1, 8)
__version__ = '.'.join((str(each) for each in VERSION[:4]))
__dbversion__ = 2 #defines current db version for migrations
__dbversion__ = 2 # defines current db version for migrations
__platform__ = platform.system()
__license__ = 'GPLv3'

PLATFORM_WIN = ('Windows',)
PLATFORM_OTHERS = ('Linux', 'Darwin', 'FreeBSD',)
Expand All @@ -45,6 +44,7 @@
if len(VERSION) > 3 and _rev:
__version__ += ' [rev:%s]' % _rev[0]


def get_version():
"""Returns shorter version (digit parts only) as string."""

Expand Down
3 changes: 2 additions & 1 deletion rhodecode/config/environment.py
Expand Up @@ -21,6 +21,7 @@

log = logging.getLogger(__name__)


def load_environment(global_conf, app_conf, initial=False):
"""Configure the Pylons environment via the ``pylons.config``
object
Expand Down Expand Up @@ -67,7 +68,7 @@ def load_environment(global_conf, app_conf, initial=False):
if config['debug'] and not test:
#use query time debugging.
sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.',
proxy=TimerProxy())
proxy=TimerProxy())
else:
sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')

Expand Down
2 changes: 1 addition & 1 deletion rhodecode/config/middleware.py
Expand Up @@ -16,6 +16,7 @@
from rhodecode.lib.middleware.https_fixup import HttpsFixup
from rhodecode.config.environment import load_environment


def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
"""Create a Pylons WSGI application and return it
Expand Down Expand Up @@ -76,4 +77,3 @@ def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
app.config = config

return app

200 changes: 114 additions & 86 deletions rhodecode/config/routing.py
Expand Up @@ -9,12 +9,13 @@
from routes import Mapper
from rhodecode.lib.utils import check_repo_fast as cr


def make_map(config):
"""Create, configure and return the routes Mapper"""
map = Mapper(directory=config['pylons.paths']['controllers'],
rmap = Mapper(directory=config['pylons.paths']['controllers'],
always_scan=config['debug'])
map.minimization = False
map.explicit = False
rmap.minimization = False
rmap.explicit = False

def check_repo(environ, match_dict):
"""
Expand All @@ -27,21 +28,22 @@ def check_repo(environ, match_dict):

# The ErrorController route (handles 404/500 error pages); it should
# likely stay at the top, ensuring it can always be resolved
map.connect('/error/{action}', controller='error')
map.connect('/error/{action}/{id}', controller='error')
rmap.connect('/error/{action}', controller='error')
rmap.connect('/error/{action}/{id}', controller='error')

#==========================================================================
# CUSTOM ROUTES HERE
#==========================================================================

#MAIN PAGE
map.connect('home', '/', controller='home', action='index')
map.connect('bugtracker', "http://bitbucket.org/marcinkuzminski/rhodecode/issues", _static=True)
map.connect('gpl_license', "http://www.gnu.org/licenses/gpl.html", _static=True)
map.connect('rhodecode_official', "http://rhodecode.org", _static=True)
rmap.connect('home', '/', controller='home', action='index')
rmap.connect('bugtracker',
"http://bitbucket.org/marcinkuzminski/rhodecode/issues",
_static=True)
rmap.connect('rhodecode_official', "http://rhodecode.org", _static=True)

#ADMIN REPOSITORY REST ROUTES
with map.submapper(path_prefix='/_admin', controller='admin/repos') as m:
with rmap.submapper(path_prefix='/_admin', controller='admin/repos') as m:
m.connect("repos", "/repos",
action="create", conditions=dict(method=["POST"]))
m.connect("repos", "/repos",
Expand Down Expand Up @@ -83,134 +85,160 @@ def check_repo(environ, match_dict):
action="repo_cache", conditions=dict(method=["DELETE"],
function=check_repo))
#ADMIN USER REST ROUTES
map.resource('user', 'users', controller='admin/users', path_prefix='/_admin')
rmap.resource('user', 'users', controller='admin/users',
path_prefix='/_admin')

#ADMIN PERMISSIONS REST ROUTES
map.resource('permission', 'permissions', controller='admin/permissions', path_prefix='/_admin')

rmap.resource('permission', 'permissions', controller='admin/permissions',
path_prefix='/_admin')

##ADMIN LDAP SETTINGS
map.connect('ldap_settings', '/_admin/ldap', controller='admin/ldap_settings',
action='ldap_settings', conditions=dict(method=["POST"]))
map.connect('ldap_home', '/_admin/ldap', controller='admin/ldap_settings',)


rmap.connect('ldap_settings', '/_admin/ldap',
controller='admin/ldap_settings', action='ldap_settings',
conditions=dict(method=["POST"]))
rmap.connect('ldap_home', '/_admin/ldap',
controller='admin/ldap_settings',)

#ADMIN SETTINGS REST ROUTES
with map.submapper(path_prefix='/_admin', controller='admin/settings') as m:
with rmap.submapper(path_prefix='/_admin',
controller='admin/settings') as m:
m.connect("admin_settings", "/settings",
action="create", conditions=dict(method=["POST"]))
action="create", conditions=dict(method=["POST"]))
m.connect("admin_settings", "/settings",
action="index", conditions=dict(method=["GET"]))
action="index", conditions=dict(method=["GET"]))
m.connect("formatted_admin_settings", "/settings.{format}",
action="index", conditions=dict(method=["GET"]))
action="index", conditions=dict(method=["GET"]))
m.connect("admin_new_setting", "/settings/new",
action="new", conditions=dict(method=["GET"]))
action="new", conditions=dict(method=["GET"]))
m.connect("formatted_admin_new_setting", "/settings/new.{format}",
action="new", conditions=dict(method=["GET"]))
action="new", conditions=dict(method=["GET"]))
m.connect("/settings/{setting_id}",
action="update", conditions=dict(method=["PUT"]))
action="update", conditions=dict(method=["PUT"]))
m.connect("/settings/{setting_id}",
action="delete", conditions=dict(method=["DELETE"]))
action="delete", conditions=dict(method=["DELETE"]))
m.connect("admin_edit_setting", "/settings/{setting_id}/edit",
action="edit", conditions=dict(method=["GET"]))
m.connect("formatted_admin_edit_setting", "/settings/{setting_id}.{format}/edit",
action="edit", conditions=dict(method=["GET"]))
action="edit", conditions=dict(method=["GET"]))
m.connect("formatted_admin_edit_setting",
"/settings/{setting_id}.{format}/edit",
action="edit", conditions=dict(method=["GET"]))
m.connect("admin_setting", "/settings/{setting_id}",
action="show", conditions=dict(method=["GET"]))
action="show", conditions=dict(method=["GET"]))
m.connect("formatted_admin_setting", "/settings/{setting_id}.{format}",
action="show", conditions=dict(method=["GET"]))
action="show", conditions=dict(method=["GET"]))
m.connect("admin_settings_my_account", "/my_account",
action="my_account", conditions=dict(method=["GET"]))
action="my_account", conditions=dict(method=["GET"]))
m.connect("admin_settings_my_account_update", "/my_account_update",
action="my_account_update", conditions=dict(method=["PUT"]))
action="my_account_update", conditions=dict(method=["PUT"]))
m.connect("admin_settings_create_repository", "/create_repository",
action="create_repository", conditions=dict(method=["GET"]))
action="create_repository", conditions=dict(method=["GET"]))

#ADMIN MAIN PAGES
with map.submapper(path_prefix='/_admin', controller='admin/admin') as m:
m.connect('admin_home', '', action='index')#main page
with rmap.submapper(path_prefix='/_admin', controller='admin/admin') as m:
m.connect('admin_home', '', action='index')
m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}',
action='add_repo')


#USER JOURNAL
map.connect('journal', '/_admin/journal', controller='journal',)
map.connect('toggle_following', '/_admin/toggle_following', controller='journal',
action='toggle_following', conditions=dict(method=["POST"]))

rmap.connect('journal', '/_admin/journal', controller='journal',)
rmap.connect('toggle_following', '/_admin/toggle_following',
controller='journal', action='toggle_following',
conditions=dict(method=["POST"]))

#SEARCH
map.connect('search', '/_admin/search', controller='search',)
map.connect('search_repo', '/_admin/search/{search_repo:.*}', controller='search')
rmap.connect('search', '/_admin/search', controller='search',)
rmap.connect('search_repo', '/_admin/search/{search_repo:.*}',
controller='search')

#LOGIN/LOGOUT/REGISTER/SIGN IN
map.connect('login_home', '/_admin/login', controller='login')
map.connect('logout_home', '/_admin/logout', controller='login', action='logout')
map.connect('register', '/_admin/register', controller='login', action='register')
map.connect('reset_password', '/_admin/password_reset', controller='login', action='password_reset')
rmap.connect('login_home', '/_admin/login', controller='login')
rmap.connect('logout_home', '/_admin/logout', controller='login',
action='logout')
rmap.connect('register', '/_admin/register', controller='login',
action='register')
rmap.connect('reset_password', '/_admin/password_reset',
controller='login', action='password_reset')

#FEEDS
map.connect('rss_feed_home', '/{repo_name:.*}/feed/rss',
rmap.connect('rss_feed_home', '/{repo_name:.*}/feed/rss',
controller='feed', action='rss',
conditions=dict(function=check_repo))
map.connect('atom_feed_home', '/{repo_name:.*}/feed/atom',
rmap.connect('atom_feed_home', '/{repo_name:.*}/feed/atom',
controller='feed', action='atom',
conditions=dict(function=check_repo))


#REPOSITORY ROUTES
map.connect('changeset_home', '/{repo_name:.*}/changeset/{revision}',
rmap.connect('changeset_home', '/{repo_name:.*}/changeset/{revision}',
controller='changeset', revision='tip',
conditions=dict(function=check_repo))
map.connect('raw_changeset_home', '/{repo_name:.*}/raw-changeset/{revision}',
controller='changeset', action='raw_changeset', revision='tip',
conditions=dict(function=check_repo))
map.connect('summary_home_', '/{repo_name:.*}',

rmap.connect('raw_changeset_home',
'/{repo_name:.*}/raw-changeset/{revision}',
controller='changeset', action='raw_changeset',
revision='tip', conditions=dict(function=check_repo))

rmap.connect('summary_home_', '/{repo_name:.*}',
controller='summary', conditions=dict(function=check_repo))
map.connect('summary_home', '/{repo_name:.*}/summary',

rmap.connect('summary_home', '/{repo_name:.*}/summary',
controller='summary', conditions=dict(function=check_repo))
map.connect('shortlog_home', '/{repo_name:.*}/shortlog',

rmap.connect('shortlog_home', '/{repo_name:.*}/shortlog',
controller='shortlog', conditions=dict(function=check_repo))
map.connect('branches_home', '/{repo_name:.*}/branches',

rmap.connect('branches_home', '/{repo_name:.*}/branches',
controller='branches', conditions=dict(function=check_repo))
map.connect('tags_home', '/{repo_name:.*}/tags',

rmap.connect('tags_home', '/{repo_name:.*}/tags',
controller='tags', conditions=dict(function=check_repo))
map.connect('changelog_home', '/{repo_name:.*}/changelog',

rmap.connect('changelog_home', '/{repo_name:.*}/changelog',
controller='changelog', conditions=dict(function=check_repo))
map.connect('files_home', '/{repo_name:.*}/files/{revision}/{f_path:.*}',

rmap.connect('files_home', '/{repo_name:.*}/files/{revision}/{f_path:.*}',
controller='files', revision='tip', f_path='',
conditions=dict(function=check_repo))
map.connect('files_diff_home', '/{repo_name:.*}/diff/{f_path:.*}',

rmap.connect('files_diff_home', '/{repo_name:.*}/diff/{f_path:.*}',
controller='files', action='diff', revision='tip', f_path='',
conditions=dict(function=check_repo))
map.connect('files_rawfile_home', '/{repo_name:.*}/rawfile/{revision}/{f_path:.*}',
controller='files', action='rawfile', revision='tip', f_path='',
conditions=dict(function=check_repo))
map.connect('files_raw_home', '/{repo_name:.*}/raw/{revision}/{f_path:.*}',
controller='files', action='raw', revision='tip', f_path='',
conditions=dict(function=check_repo))
map.connect('files_annotate_home', '/{repo_name:.*}/annotate/{revision}/{f_path:.*}',
controller='files', action='annotate', revision='tip', f_path='',
conditions=dict(function=check_repo))
map.connect('files_archive_home', '/{repo_name:.*}/archive/{revision}/{fileformat}',
controller='files', action='archivefile', revision='tip',
conditions=dict(function=check_repo))
map.connect('repo_settings_delete', '/{repo_name:.*}/settings',
controller='settings', action="delete",
conditions=dict(method=["DELETE"], function=check_repo))
map.connect('repo_settings_update', '/{repo_name:.*}/settings',
controller='settings', action="update",
conditions=dict(method=["PUT"], function=check_repo))
map.connect('repo_settings_home', '/{repo_name:.*}/settings',
controller='settings', action='index',
conditions=dict(function=check_repo))

map.connect('repo_fork_create_home', '/{repo_name:.*}/fork',
rmap.connect('files_rawfile_home',
'/{repo_name:.*}/rawfile/{revision}/{f_path:.*}',
controller='files', action='rawfile', revision='tip',
f_path='', conditions=dict(function=check_repo))

rmap.connect('files_raw_home',
'/{repo_name:.*}/raw/{revision}/{f_path:.*}',
controller='files', action='raw', revision='tip', f_path='',
conditions=dict(function=check_repo))

rmap.connect('files_annotate_home',
'/{repo_name:.*}/annotate/{revision}/{f_path:.*}',
controller='files', action='annotate', revision='tip',
f_path='', conditions=dict(function=check_repo))

rmap.connect('files_archive_home',
'/{repo_name:.*}/archive/{revision}/{fileformat}',
controller='files', action='archivefile', revision='tip',
conditions=dict(function=check_repo))

rmap.connect('repo_settings_delete', '/{repo_name:.*}/settings',
controller='settings', action="delete",
conditions=dict(method=["DELETE"], function=check_repo))

rmap.connect('repo_settings_update', '/{repo_name:.*}/settings',
controller='settings', action="update",
conditions=dict(method=["PUT"], function=check_repo))

rmap.connect('repo_settings_home', '/{repo_name:.*}/settings',
controller='settings', action='index',
conditions=dict(function=check_repo))

rmap.connect('repo_fork_create_home', '/{repo_name:.*}/fork',
controller='settings', action='fork_create',
conditions=dict(function=check_repo, method=["POST"]))
map.connect('repo_fork_home', '/{repo_name:.*}/fork',
rmap.connect('repo_fork_home', '/{repo_name:.*}/fork',
controller='settings', action='fork',
conditions=dict(function=check_repo))

return map
return rmap

0 comments on commit dfba4af

Please sign in to comment.