comparison rhodecode/config/post_receive_tmpl.py @ 2411:d3978233fcfa beta

chmod the hooks to 755, like all other githooks. fix hook template name
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 07 Jun 2012 13:09:07 +0200
parents rhodecode/config/pre_receive_tmpl.py@761e00380370
children c0ec29b20eb6
comparison
equal deleted inserted replaced
2410:a1595b6e1445 2411:d3978233fcfa
1 #!/usr/bin/env python
2 import os
3 import sys
4
5 try:
6 import rhodecode
7 from rhodecode.lib.hooks import handle_git_post_receive
8 except ImportError:
9 rhodecode = None
10
11
12 def main():
13 if rhodecode is None:
14 # exit with success if we cannot import rhodecode !!
15 # this allows simply push to this repo even without
16 # rhodecode
17 sys.exit(0)
18
19 repo_path = os.path.abspath('.')
20 push_data = sys.stdin.read().strip().split(' ')
21 # os.environ is modified here by a subprocess call that
22 # runs git and later git executes this hook.
23 # Environ get's some additional info from rhodecode system
24 # like IP or username from basic-auth
25 handle_git_post_receive(repo_path, push_data, os.environ)
26 sys.exit(0)
27
28 if __name__ == '__main__':
29 main()