##// END OF EJS Templates
extensions: adapt hooks to latest version of extensions (pre-push)
marcink -
r1456:c0280798 default
parent child Browse files
Show More
@@ -93,6 +93,7 b' def pre_push(extras):'
93
93
94 It bans pushing when the repository is locked.
94 It bans pushing when the repository is locked.
95 """
95 """
96
96 usr = User.get_by_username(extras.username)
97 usr = User.get_by_username(extras.username)
97 output = ''
98 output = ''
98 if extras.locked_by[0] and usr.user_id != int(extras.locked_by[0]):
99 if extras.locked_by[0] and usr.user_id != int(extras.locked_by[0]):
@@ -287,7 +288,7 b' pre_push_extension = ExtensionCallback('
287 hook_name='PRE_PUSH_HOOK',
288 hook_name='PRE_PUSH_HOOK',
288 kwargs_keys=(
289 kwargs_keys=(
289 'server_url', 'config', 'scm', 'username', 'ip', 'action',
290 'server_url', 'config', 'scm', 'username', 'ip', 'action',
290 'repository', 'repo_store_path'))
291 'repository', 'repo_store_path', 'commit_ids'))
291
292
292
293
293 post_push_extension = ExtensionCallback(
294 post_push_extension = ExtensionCallback(
@@ -69,7 +69,7 b' def load_extension(filename, async=False'
69 # used for building stats
69 # used for building stats
70 # format is {'ext':['Names']} eg. {'py':['Python']} note: there can be
70 # format is {'ext':['Names']} eg. {'py':['Python']} note: there can be
71 # more than one name for extension
71 # more than one name for extension
72 # NOTE: that this will overide any mappings in LANGUAGES_EXTENSIONS_MAP
72 # NOTE: that this will override any mappings in LANGUAGES_EXTENSIONS_MAP
73 # build by pygments
73 # build by pygments
74 EXTRA_MAPPINGS = {}
74 EXTRA_MAPPINGS = {}
75
75
@@ -348,7 +348,7 b' def _prepushhook(*args, **kwargs):'
348
348
349 expected_parameters = (
349 expected_parameters = (
350 'server_url', 'config', 'scm', 'username', 'ip', 'action',
350 'server_url', 'config', 'scm', 'username', 'ip', 'action',
351 'repository', 'repo_store_path')
351 'repository', 'repo_store_path', 'commit_ids')
352 _verify_kwargs(expected_parameters, kwargs)
352 _verify_kwargs(expected_parameters, kwargs)
353
353
354 return 0
354 return 0
@@ -516,5 +516,5 b' def _verify_kwargs(expected_parameters, '
516 missing_kwargs = expected_parameters - kwargs_keys
516 missing_kwargs = expected_parameters - kwargs_keys
517 unexpected_kwargs = kwargs_keys - expected_parameters
517 unexpected_kwargs = kwargs_keys - expected_parameters
518 raise AssertionError(
518 raise AssertionError(
519 "Missing parameters: %r, unexpected parameters: %s" %
519 "rcextensions: Missing parameters: %r, unexpected parameters: %s" %
520 (missing_kwargs, unexpected_kwargs))
520 (missing_kwargs, unexpected_kwargs))
General Comments 0
You need to be logged in to leave comments. Login now