Submitter | Boris Feld |
---|---|
Date | Oct. 9, 2017, 6:36 p.m. |
Message ID | <29bb94cd7a882b572324.1507574179@FB> |
Download | mbox | patch |
Permalink | /patch/24661/ |
State | Superseded |
Headers | show |
Comments
Patch
diff -r 8cef8f7d51d0 -r 29bb94cd7a88 mercurial/hook.py --- a/mercurial/hook.py Thu Oct 05 20:41:50 2017 -0700 +++ 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