##// END OF EJS Templates
changed scope of calling EXTENSIONS from rhodecode for githooks to be able to execute them
marcink -
r2406:7be31af5 beta
parent child Browse files
Show More
@@ -30,7 +30,6 b' from inspect import isfunction'
30 from mercurial.scmutil import revrange
30 from mercurial.scmutil import revrange
31 from mercurial.node import nullrev
31 from mercurial.node import nullrev
32
32
33 from rhodecode import EXTENSIONS
34 from rhodecode.lib import helpers as h
33 from rhodecode.lib import helpers as h
35 from rhodecode.lib.utils import action_logger
34 from rhodecode.lib.utils import action_logger
36 from rhodecode.lib.vcs.backends.base import EmptyChangeset
35 from rhodecode.lib.vcs.backends.base import EmptyChangeset
@@ -100,6 +99,7 b' def log_pull_action(ui, repo, **kwargs):'
100
99
101 action_logger(username, action, repository, extras['ip'], commit=True)
100 action_logger(username, action, repository, extras['ip'], commit=True)
102 # extension hook call
101 # extension hook call
102 from rhodecode import EXTENSIONS
103 callback = getattr(EXTENSIONS, 'PULL_HOOK', None)
103 callback = getattr(EXTENSIONS, 'PULL_HOOK', None)
104
104
105 if isfunction(callback):
105 if isfunction(callback):
@@ -149,6 +149,7 b' def log_push_action(ui, repo, **kwargs):'
149 action_logger(username, action, repository, extras['ip'], commit=True)
149 action_logger(username, action, repository, extras['ip'], commit=True)
150
150
151 # extension hook call
151 # extension hook call
152 from rhodecode import EXTENSIONS
152 callback = getattr(EXTENSIONS, 'PUSH_HOOK', None)
153 callback = getattr(EXTENSIONS, 'PUSH_HOOK', None)
153 if isfunction(callback):
154 if isfunction(callback):
154 kw = {'pushed_revs': revs}
155 kw = {'pushed_revs': revs}
@@ -183,7 +184,7 b' def log_create_repository(repository_dic'
183 'repo_name'
184 'repo_name'
184
185
185 """
186 """
186
187 from rhodecode import EXTENSIONS
187 callback = getattr(EXTENSIONS, 'CREATE_REPO_HOOK', None)
188 callback = getattr(EXTENSIONS, 'CREATE_REPO_HOOK', None)
188 if isfunction(callback):
189 if isfunction(callback):
189 kw = {}
190 kw = {}
@@ -127,7 +127,8 b' class GitRepository(object):'
127 # env and connect to db
127 # env and connect to db
128 gitenv['RHODECODE_CONFIG_FILE'] = CONFIG['__file__']
128 gitenv['RHODECODE_CONFIG_FILE'] = CONFIG['__file__']
129 opts = dict(
129 opts = dict(
130 env=gitenv
130 env=gitenv,
131 cwd=os.getcwd()
131 )
132 )
132 out = subprocessio.SubprocessIOChunker(
133 out = subprocessio.SubprocessIOChunker(
133 r'git %s --stateless-rpc "%s"' % (git_command[4:],
134 r'git %s --stateless-rpc "%s"' % (git_command[4:],
General Comments 0
You need to be logged in to leave comments. Login now