Changeset - 9bc1ee41df8c
[Not reviewed]
default
0 3 0
domruf - 8 years ago 2018-01-25 21:49:33
dominikruf@gmail.com
Grafted from: b6e09bf7852f
hooks: rename 'push_data' and 'revs' to git_stdin_lines

...to better reflect what it is.
3 files changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
kallithea/config/post_receive_tmpl.py
Show inline comments
 
@@ -17,12 +17,12 @@ from kallithea.lib.hooks import handle_g
 

	
 
def main():
 
    repo_path = os.path.abspath('.')
 
    push_data = sys.stdin.readlines()
 
    git_stdin_lines = sys.stdin.readlines()
 
    # os.environ is modified here by a subprocess call that
 
    # runs git and later git executes this hook.
 
    # Environ gets some additional info from kallithea system
 
    # like IP or username from basic-auth
 
    _handler(repo_path, push_data, os.environ)
 
    _handler(repo_path, git_stdin_lines, os.environ)
 
    sys.exit(0)
 

	
 

	
kallithea/config/pre_receive_tmpl.py
Show inline comments
 
@@ -17,12 +17,12 @@ from kallithea.lib.hooks import handle_g
 

	
 
def main():
 
    repo_path = os.path.abspath('.')
 
    push_data = sys.stdin.readlines()
 
    git_stdin_lines = sys.stdin.readlines()
 
    # os.environ is modified here by a subprocess call that
 
    # runs git and later git executes this hook.
 
    # Environ gets some additional info from kallithea system
 
    # like IP or username from basic-auth
 
    _handler(repo_path, push_data, os.environ)
 
    _handler(repo_path, git_stdin_lines, os.environ)
 
    sys.exit(0)
 

	
 

	
kallithea/lib/hooks.py
Show inline comments
 
@@ -364,15 +364,15 @@ def log_delete_user(user_dict, deleted_b
 
    return 0
 

	
 

	
 
def handle_git_pre_receive(repo_path, revs, env):
 
    return handle_git_receive(repo_path, revs, env, hook_type='pre')
 
def handle_git_pre_receive(repo_path, git_stdin_lines, env):
 
    return handle_git_receive(repo_path, git_stdin_lines, env, hook_type='pre')
 

	
 

	
 
def handle_git_post_receive(repo_path, revs, env):
 
    return handle_git_receive(repo_path, revs, env, hook_type='post')
 
def handle_git_post_receive(repo_path, git_stdin_lines, env):
 
    return handle_git_receive(repo_path, git_stdin_lines, env, hook_type='post')
 

	
 

	
 
def handle_git_receive(repo_path, revs, env, hook_type):
 
def handle_git_receive(repo_path, git_stdin_lines, env, hook_type):
 
    """
 
    A really hacky method that is run by git post-receive hook and logs
 
    a push action together with pushed revisions. It's executed by subprocess
 
@@ -425,7 +425,7 @@ def handle_git_receive(repo_path, revs, 
 
    # if push hook is enabled via web interface
 
    elif hook_type == 'post' and _hooks.get(Ui.HOOK_PUSH):
 
        rev_data = []
 
        for l in revs:
 
        for l in git_stdin_lines:
 
            old_rev, new_rev, ref = l.strip().split(' ')
 
            _ref_data = ref.split('/')
 
            if _ref_data[1] in ['tags', 'heads']:
0 comments (0 inline, 0 general)