##// END OF EJS Templates
hooks: store hook type for extensions.
marcink -
r555:315f8a04 default
parent child Browse files
Show More
@@ -270,6 +270,7 b' def pre_push(ui, repo, node=None, **kwar'
270 270 for push_ref in rev_data:
271 271 push_ref['multiple_heads'] = _heads
272 272
273 extras['hook_type'] = kwargs.get('hooktype', 'pre_push')
273 274 extras['commit_ids'] = rev_data
274 275 return _call_hook('pre_push', extras, HgMessageWriter(ui))
275 276
@@ -319,6 +320,7 b' def post_push(ui, repo, node, **kwargs):'
319 320 if hasattr(ui, '_rc_pushkey_branches'):
320 321 bookmarks = ui._rc_pushkey_branches
321 322
323 extras['hook_type'] = kwargs.get('hooktype', 'post_push')
322 324 extras['commit_ids'] = commit_ids
323 325 extras['new_refs'] = {
324 326 'branches': branches,
@@ -476,6 +478,7 b' def git_pre_receive(unused_repo_path, re'
476 478 if stdout:
477 479 push_ref['pruned_sha'] = stdout.splitlines()
478 480
481 extras['hook_type'] = 'pre_receive'
479 482 extras['commit_ids'] = rev_data
480 483 return _call_hook('pre_push', extras, GitMessageWriter())
481 484
@@ -555,6 +558,7 b' def git_post_receive(unused_repo_path, r'
555 558 tags.append(push_ref['name'])
556 559 git_revs.append('tag=>%s' % push_ref['name'])
557 560
561 extras['hook_type'] = 'post_receive'
558 562 extras['commit_ids'] = git_revs
559 563 extras['new_refs'] = {
560 564 'branches': branches,
@@ -77,7 +77,7 b' def no_newline_id_generator(test_name):'
77 77 nicer output of progress of test
78 78 """
79 79 org_name = test_name
80 test_name = test_name\
80 test_name = str(test_name)\
81 81 .replace('\n', '_N') \
82 82 .replace('\r', '_N') \
83 83 .replace('\t', '_T') \
@@ -70,7 +70,7 b' def test_git_post_receive_calls_repo_siz'
70 70 with mock.patch.object(hooks, '_call_hook') as call_hook_mock:
71 71 hooks.git_post_receive(
72 72 None, '', {'RC_SCM_DATA': json.dumps(extras)})
73 extras.update({'commit_ids': [],
73 extras.update({'commit_ids': [], 'hook_type': 'post_receive',
74 74 'new_refs': {'bookmarks': [], 'branches': [], 'tags': []}})
75 75 expected_calls = [
76 76 mock.call('repo_size', extras, mock.ANY),
@@ -84,7 +84,7 b' def test_git_post_receive_does_not_call_'
84 84 with mock.patch.object(hooks, '_call_hook') as call_hook_mock:
85 85 hooks.git_post_receive(
86 86 None, '', {'RC_SCM_DATA': json.dumps(extras)})
87 extras.update({'commit_ids': [],
87 extras.update({'commit_ids': [], 'hook_type': 'post_receive',
88 88 'new_refs': {'bookmarks': [], 'branches': [], 'tags': []}})
89 89 expected_calls = [
90 90 mock.call('post_push', extras, mock.ANY)
General Comments 0
You need to be logged in to leave comments. Login now