Exemplo n.º 1
0
    def _handle_githooks(self, repo_name, action, baseui, environ):
        from rhodecode.lib.hooks import log_pull_action, log_push_action
        service = environ['QUERY_STRING'].split('=')
        if len(service) < 2:
            return

        from rhodecode.model.db import Repository
        _repo = Repository.get_by_repo_name(repo_name)
        _repo = _repo.scm_instance
        _repo._repo.ui = baseui

        push_hook = 'pretxnchangegroup.push_logger'
        pull_hook = 'preoutgoing.pull_logger'
        _hooks = dict(baseui.configitems('hooks')) or {}
        if action == 'push' and _hooks.get(push_hook):
            log_push_action(ui=baseui, repo=_repo._repo)
        elif action == 'pull' and _hooks.get(pull_hook):
            log_pull_action(ui=baseui, repo=_repo._repo)
Exemplo n.º 2
0
    def _handle_githooks(self, repo_name, action, baseui, environ):
        from rhodecode.lib.hooks import log_pull_action, log_push_action
        service = environ['QUERY_STRING'].split('=')
        if len(service) < 2:
            return

        from rhodecode.model.db import Repository
        _repo = Repository.get_by_repo_name(repo_name)
        _repo = _repo.scm_instance
        _repo._repo.ui = baseui

        push_hook = 'pretxnchangegroup.push_logger'
        pull_hook = 'preoutgoing.pull_logger'
        _hooks = dict(baseui.configitems('hooks')) or {}
        if action == 'push' and _hooks.get(push_hook):
            log_push_action(ui=baseui, repo=_repo._repo)
        elif action == 'pull' and _hooks.get(pull_hook):
            log_pull_action(ui=baseui, repo=_repo._repo)
Exemplo n.º 3
0
    def _handle_githooks(self, repo_name, action, baseui, environ):
        """
        Handles pull action, push is handled by post-receive hook
        """
        from rhodecode.lib.hooks import log_pull_action
        service = environ['QUERY_STRING'].split('=')

        if len(service) < 2:
            return

        from rhodecode.model.db import Repository
        _repo = Repository.get_by_repo_name(repo_name)
        _repo = _repo.scm_instance

        _hooks = dict(baseui.configitems('hooks')) or {}
        if action == 'pull':
            # stupid git, emulate pre-pull hook !
            pre_pull(ui=baseui, repo=_repo._repo)
        if action == 'pull' and _hooks.get(RhodeCodeUi.HOOK_PULL):
            log_pull_action(ui=baseui, repo=_repo._repo)
Exemplo n.º 4
0
    def _handle_githooks(self, repo_name, action, baseui, environ):
        """
        Handles pull action, push is handled by post-receive hook
        """
        from rhodecode.lib.hooks import log_pull_action
        service = environ['QUERY_STRING'].split('=')

        if len(service) < 2:
            return

        from rhodecode.model.db import Repository
        _repo = Repository.get_by_repo_name(repo_name)
        _repo = _repo.scm_instance

        _hooks = dict(baseui.configitems('hooks')) or {}
        if action == 'pull':
            # stupid git, emulate pre-pull hook !
            pre_pull(ui=baseui, repo=_repo._repo)
        if action == 'pull' and _hooks.get(RhodeCodeUi.HOOK_PULL):
            log_pull_action(ui=baseui, repo=_repo._repo)