Mercurial > kallithea
changeset 2991:578a152f5ae3 beta
added missing installation of git hooks when doing a fork
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 07 Nov 2012 23:36:28 +0100 |
parents | 0bc7b5895242 |
children | 3bc8d2e08966 |
files | rhodecode/lib/celerylib/tasks.py |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/celerylib/tasks.py Wed Nov 07 20:50:58 2012 +0100 +++ b/rhodecode/lib/celerylib/tasks.py Wed Nov 07 23:36:28 2012 +0100 @@ -50,6 +50,7 @@ from rhodecode.lib.hooks import log_create_repository from rhodecode.model.db import Statistics, Repository, User +from rhodecode.model.scm import ScmModel add_cache(config) @@ -402,17 +403,19 @@ backend = get_backend(repo_type) if repo_type == 'git': - backend(safe_str(destination_fork_path), create=True, + r = backend(safe_str(destination_fork_path), create=True, src_url=safe_str(source_repo_path), update_after_clone=update_after_clone, bare=True) elif repo_type == 'hg': - backend(safe_str(destination_fork_path), create=True, + 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,