changeset 34687 | e79b6300d97c |
parent 32897 | 799db2af824c |
child 35357 | 056a9c8813aa |
--- a/mercurial/hook.py Fri Oct 13 22:42:17 2017 +0200 +++ b/mercurial/hook.py Sun Oct 08 13:08:31 2017 +0200 @@ -189,6 +189,15 @@ global _redirect _redirect = state +def hashook(ui, htype): + """return True if a hook is configured for 'htype'""" + if not ui.callhooks: + return False + for hname, cmd in _allhooks(ui): + if hname.split('.')[0] == htype and cmd: + return True + return False + def hook(ui, repo, htype, throw=False, **args): if not ui.callhooks: return False