Changeset - e2f3c8e6939d
[Not reviewed]
beta
0 4 0
Marcin Kuzminski - 15 years ago 2010-11-18 02:41:38
marcin@python-works.com
Disable git support due to large problems with dulwich.
Added one point of controll over supported backends in rhodecode.BACKENDS
4 files changed with 15 insertions and 8 deletions:
0 comments (0 inline, 0 general)
rhodecode/__init__.py
Show inline comments
 
@@ -33,3 +33,8 @@ def get_version():
 
    Returns shorter version (digit parts only) as string.
 
    """
 
    return '.'.join((str(each) for each in VERSION[:3]))
 

	
 
BACKENDS = {
 
    'hg': 'Mercurial repository',
 
   #'git': 'Git repository',
 
}
rhodecode/lib/base.py
Show inline comments
 
@@ -10,7 +10,7 @@ from rhodecode.lib import auth
 
from rhodecode.lib.utils import get_repo_slug
 
from rhodecode.model import meta
 
from rhodecode.model.scm import ScmModel
 
from vcs import BACKENDS
 
from rhodecode import BACKENDS
 

	
 
class BaseController(WSGIController):
 

	
rhodecode/model/forms.py
Show inline comments
 
@@ -31,7 +31,7 @@ from rhodecode.model.user import UserMod
 
from rhodecode.model.repo import RepoModel
 
from rhodecode.model.db import User
 
from webhelpers.pylonslib.secure_form import authentication_token
 
from vcs import BACKENDS
 
from rhodecode import BACKENDS
 
import formencode
 
import logging
 
import os
 
@@ -301,28 +301,28 @@ def PasswordResetForm():
 
        email = All(ValidSystemEmail(), Email(not_empty=True))
 
    return _PasswordResetForm
 

	
 
def RepoForm(edit=False, old_data={}):
 
def RepoForm(edit=False, old_data={}, supported_backends=BACKENDS.keys()):
 
    class _RepoForm(formencode.Schema):
 
        allow_extra_fields = True
 
        filter_extra_fields = False
 
        repo_name = All(UnicodeString(strip=True, min=1, not_empty=True), ValidRepoName(edit, old_data))
 
        description = UnicodeString(strip=True, min=1, not_empty=True)
 
        private = StringBoolean(if_missing=False)
 
        repo_type = OneOf(BACKENDS.keys())
 
        repo_type = OneOf(supported_backends)
 
        if edit:
 
            user = All(Int(not_empty=True), ValidRepoUser)
 

	
 
        chained_validators = [ValidPerms]
 
    return _RepoForm
 

	
 
def RepoForkForm(edit=False, old_data={}):
 
def RepoForkForm(edit=False, old_data={}, supported_backends=BACKENDS.keys()):
 
    class _RepoForkForm(formencode.Schema):
 
        allow_extra_fields = True
 
        filter_extra_fields = False
 
        fork_name = All(UnicodeString(strip=True, min=1, not_empty=True), ValidRepoName(edit, old_data))
 
        description = UnicodeString(strip=True, min=1, not_empty=True)
 
        private = StringBoolean(if_missing=False)
 
        repo_type = All(ValidForkType(old_data), OneOf(BACKENDS.keys()))
 
        repo_type = All(ValidForkType(old_data), OneOf(supported_backends))
 
    return _RepoForkForm
 

	
 
def RepoSettingsForm(edit=False, old_data={}):
rhodecode/model/scm.py
Show inline comments
 
@@ -24,6 +24,7 @@ Model for RhodeCode
 
"""
 
from beaker.cache import cache_region, region_invalidate
 
from mercurial import ui
 
from rhodecode import BACKENDS
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.auth import HasRepoPermissionAny
 
from rhodecode.lib.utils import get_repos
 
@@ -84,10 +85,10 @@ class ScmModel(object):
 

	
 
                    klass = get_backend(path[0])
 

	
 
                    if path[0] == 'hg':
 
                    if path[0] == 'hg' and path[0] in BACKENDS.keys():
 
                        repos_list[name] = klass(path[1], baseui=baseui)
 

	
 
                    if path[0] == 'git':
 
                    if path[0] == 'git' and path[0] in BACKENDS.keys():
 
                        repos_list[name] = klass(path[1])
 
            except OSError:
 
                continue
 
@@ -152,6 +153,7 @@ class ScmModel(object):
 
            log.debug('Creating instance of %s repository', alias)
 
            backend = get_backend(alias)
 

	
 
            #TODO: get the baseui from somewhere for this
 
            if alias == 'hg':
 
                repo = backend(repo_path, create=False, baseui=None)
 
                #skip hidden web repository
0 comments (0 inline, 0 general)