Changeset - 3bc8d2e08966
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2012-11-08 14:24:31
marcin@python-works.com
git hook installation should be only executed for git backend
2 files changed with 6 insertions and 7 deletions:
0 comments (0 inline, 0 general)
docs/usage/git_support.rst
Show inline comments
 
.. _git_support:
 

	
 
===========
 
GIT support
 
===========
 

	
 

	
 
Git support in RhodeCode 1.3 was enabled by default. You need to have a git
 
client installed on the machine to make git fully work.
 

	
 
Although There are some limitations on git usage.
 
Although There is one limitation on git usage.
 

	
 
- hooks that are executed on pull/push are not *real* hooks, they are 
 
  just emulating the behavior, and are executed **BEFORE** action takes place.
 
- large pushes needs http server with chunked encoding support.
 
- large pushes requires a http server with chunked encoding support.
 
 
 
if you plan to use git you need to run RhodeCode with some
 
http server that supports chunked encoding which git http protocol uses, 
 
i recommend using waitress_ or gunicorn_ (linux only) for `paste` wsgi app 
 
replacement.
 
replacement. Starting from version 1.4 waitress_ is the default wsgi server
 
used in RhodeCode.
 

	
 
To use, simply change change the following in the .ini file::
 

	
 
    use = egg:Paste#http
 

	
 
to::
 
    
 
    use = egg:waitress#main
 

	
 
or::
 

	
 
    use = egg:gunicorn#main
 
    
 
    
 
And comment out bellow options::
 

	
 
    threadpool_workers = 
 
    threadpool_max_requests = 
 
    use_threadpool = 
 
    
 

	
 
You can simply run `paster serve` as usual.
 

	
 
  
rhodecode/lib/celerylib/tasks.py
Show inline comments
 
@@ -386,57 +386,57 @@ def create_repo_fork(form_data, cur_user
 
    landing_rev = form_data['landing_rev']
 
    copy_fork_permissions = form_data.get('copy_permissions')
 
    fork_of = RepoModel(DBS)._get_repo(form_data.get('fork_parent_id'))
 

	
 
    fork_repo = RepoModel(DBS).create_repo(
 
        fork_name, repo_type, description, owner, private, clone_uri,
 
        repos_group, landing_rev, just_db=True, fork_of=fork_of,
 
        copy_fork_permissions=copy_fork_permissions
 
    )
 

	
 
    update_after_clone = form_data['update_after_clone']
 

	
 
    source_repo_path = os.path.join(base_path, fork_of.repo_name)
 
    destination_fork_path = os.path.join(base_path, fork_name)
 

	
 
    log.info('creating fork of %s as %s', source_repo_path,
 
             destination_fork_path)
 
    backend = get_backend(repo_type)
 

	
 
    if repo_type == 'git':
 
        r = backend(safe_str(destination_fork_path), create=True,
 
                src_url=safe_str(source_repo_path),
 
                update_after_clone=update_after_clone,
 
                bare=True)
 
        # add rhodecode hook into this repo
 
        ScmModel().install_git_hook(repo=r)
 
    elif repo_type == 'hg':
 
        r = backend(safe_str(destination_fork_path), create=True,
 
                src_url=safe_str(source_repo_path),
 
                update_after_clone=update_after_clone)
 
    else:
 
        raise Exception('Unknown backend type %s' % repo_type)
 

	
 
    # add rhodecode hook into this repo
 
    ScmModel().install_git_hook(repo=r)
 
    log_create_repository(fork_repo.get_dict(), created_by=cur_user.username)
 

	
 
    action_logger(cur_user, 'user_forked_repo:%s' % fork_name,
 
                   fork_of.repo_name, '', DBS)
 

	
 
    action_logger(cur_user, 'user_created_fork:%s' % fork_name,
 
                   fork_name, '', DBS)
 
    # finally commit at latest possible stage
 
    DBS.commit()
 

	
 

	
 
def __get_codes_stats(repo_name):
 
    from rhodecode.config.conf import  LANGUAGES_EXTENSIONS_MAP
 
    repo = Repository.get_by_repo_name(repo_name).scm_instance
 

	
 
    tip = repo.get_changeset()
 
    code_stats = {}
 

	
 
    def aggregate(cs):
 
        for f in cs[2]:
 
            ext = lower(f.extension)
 
            if ext in LANGUAGES_EXTENSIONS_MAP.keys() and not f.is_binary:
 
                if ext in code_stats:
 
                    code_stats[ext] += 1
0 comments (0 inline, 0 general)