##// END OF EJS Templates
hooks: added shadow repo dedicated dummy hook....
marcink -
r780:baf64deb default
parent child Browse files
Show More
@@ -81,6 +81,12 b' class HooksDummyClient(object):'
81 return getattr(hooks, hook_name)(extras)
81 return getattr(hooks, hook_name)(extras)
82
82
83
83
84 class HooksShadowRepoClient(object):
85
86 def __call__(self, hook_name, extras):
87 return {'output': '', 'status': 0}
88
89
84 class RemoteMessageWriter(object):
90 class RemoteMessageWriter(object):
85 """Writer base class."""
91 """Writer base class."""
86 def write(self, message):
92 def write(self, message):
@@ -141,9 +147,12 b' def _handle_exception(result):'
141
147
142
148
143 def _get_hooks_client(extras):
149 def _get_hooks_client(extras):
144 if 'hooks_uri' in extras:
150 hooks_uri = extras.get('hooks_uri')
145 protocol = extras.get('hooks_protocol')
151 is_shadow_repo = extras.get('is_shadow_repo')
152 if hooks_uri:
146 return HooksHttpClient(extras['hooks_uri'])
153 return HooksHttpClient(extras['hooks_uri'])
154 elif is_shadow_repo:
155 return HooksShadowRepoClient()
147 else:
156 else:
148 return HooksDummyClient(extras['hooks_module'])
157 return HooksDummyClient(extras['hooks_module'])
149
158
General Comments 0
You need to be logged in to leave comments. Login now