Mercurial > kallithea
changeset 7179:9bc1ee41df8c
hooks: rename 'push_data' and 'revs' to git_stdin_lines
...to better reflect what it is.
author | domruf <dominikruf@gmail.com> |
---|---|
date | Thu, 25 Jan 2018 21:49:33 +0100 |
parents | b752e8e27e76 |
children | f72ead70a22f |
files | kallithea/config/post_receive_tmpl.py kallithea/config/pre_receive_tmpl.py kallithea/lib/hooks.py |
diffstat | 3 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/config/post_receive_tmpl.py Thu Jan 25 21:49:14 2018 +0100 +++ b/kallithea/config/post_receive_tmpl.py Thu Jan 25 21:49:33 2018 +0100 @@ -17,12 +17,12 @@ 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)
--- a/kallithea/config/pre_receive_tmpl.py Thu Jan 25 21:49:14 2018 +0100 +++ b/kallithea/config/pre_receive_tmpl.py Thu Jan 25 21:49:33 2018 +0100 @@ -17,12 +17,12 @@ 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)
--- a/kallithea/lib/hooks.py Thu Jan 25 21:49:14 2018 +0100 +++ b/kallithea/lib/hooks.py Thu Jan 25 21:49:33 2018 +0100 @@ -364,15 +364,15 @@ 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 @@ # 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']: