annotate rhodecode/config/post_receive_tmpl.py @ 4116:ffd45b185016 rhodecode-2.2.5-gpl

Imported some of the GPLv3'd changes from RhodeCode v2.2.5. This imports changes between changesets 21af6c4eab3d and 6177597791c2 in RhodeCode's original repository, including only changes to Python files and HTML. RhodeCode clearly licensed its changes to these files under GPLv3 in their /LICENSE file, which states the following: The Python code and integrated HTML are licensed under the GPLv3 license. (See: https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE or http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE for an online copy of that LICENSE file) Conservancy reviewed these changes and confirmed that they can be licensed as a whole to the Kallithea project under GPLv3-only. While some of the contents committed herein are clearly licensed GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the statement above from RhodeCode indicates that they intend GPLv3-only as their license, per GPLv3ยง14 and other relevant sections of GPLv3.
author Bradley M. Kuhn <bkuhn@sfconservancy.org>
date Wed, 02 Jul 2014 19:03:13 -0400
parents a5888ca796b5
children 7e5f8c12a3fc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2402
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 #!/usr/bin/env python
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 import os
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 import sys
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 try:
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 import rhodecode
2617
c0ec29b20eb6 Fixed githooks for fetching multiple tags and branches.
Marcin Kuzminski <marcin@python-works.com>
parents: 2411
diff changeset
7 RC_HOOK_VER = '_TMPL_'
c0ec29b20eb6 Fixed githooks for fetching multiple tags and branches.
Marcin Kuzminski <marcin@python-works.com>
parents: 2411
diff changeset
8 os.environ['RC_HOOK_VER'] = RC_HOOK_VER
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4089
diff changeset
9 from rhodecode.lib.hooks import handle_git_post_receive as _handler
2402
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 except ImportError:
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4089
diff changeset
11 if os.environ.get('RC_DEBUG_GIT_HOOK'):
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4089
diff changeset
12 import traceback
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4089
diff changeset
13 print traceback.format_exc()
2402
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 rhodecode = None
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17 def main():
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18 if rhodecode is None:
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 # exit with success if we cannot import rhodecode !!
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 # this allows simply push to this repo even without
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 # rhodecode
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 sys.exit(0)
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23
2409
761e00380370 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2404
diff changeset
24 repo_path = os.path.abspath('.')
2617
c0ec29b20eb6 Fixed githooks for fetching multiple tags and branches.
Marcin Kuzminski <marcin@python-works.com>
parents: 2411
diff changeset
25 push_data = sys.stdin.readlines()
2402
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
26 # os.environ is modified here by a subprocess call that
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 # runs git and later git executes this hook.
4089
a5888ca796b5 Fixed spelling of get's to gets
Marcin Kuzminski <marcin@python-works.com>
parents: 2617
diff changeset
28 # Environ gets some additional info from rhodecode system
2402
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29 # like IP or username from basic-auth
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4089
diff changeset
30 _handler(repo_path, push_data, os.environ)
2402
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31 sys.exit(0)
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32
2eeb2ed72e55 Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33 if __name__ == '__main__':
2409
761e00380370 whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2404
diff changeset
34 main()