##// END OF EJS Templates
hook: add a 'hashook' function to test for hook existence...
Boris Feld -
r34688:e79b6300 default
parent child Browse files
Show More
@@ -189,6 +189,15 b' def redirect(state):'
189 global _redirect
189 global _redirect
190 _redirect = state
190 _redirect = state
191
191
192 def hashook(ui, htype):
193 """return True if a hook is configured for 'htype'"""
194 if not ui.callhooks:
195 return False
196 for hname, cmd in _allhooks(ui):
197 if hname.split('.')[0] == htype and cmd:
198 return True
199 return False
200
192 def hook(ui, repo, htype, throw=False, **args):
201 def hook(ui, repo, htype, throw=False, **args):
193 if not ui.callhooks:
202 if not ui.callhooks:
194 return False
203 return False
General Comments 0
You need to be logged in to leave comments. Login now