comparison mercurial/hook.py @ 17048:15d4d475de9e stable

ui: add a variable to control whether hooks should be called So hooks can be temporarily disabled.
author Idan Kamara <idankk86@gmail.com>
date Sat, 23 Jun 2012 19:57:07 +0300
parents 30c34fde40cc
children 1b2b727a885f
comparison
equal deleted inserted replaced
17047:d63fb1fce977 17048:15d4d475de9e
136 def redirect(state): 136 def redirect(state):
137 global _redirect 137 global _redirect
138 _redirect = state 138 _redirect = state
139 139
140 def hook(ui, repo, name, throw=False, **args): 140 def hook(ui, repo, name, throw=False, **args):
141 if not ui.callhooks:
142 return False
143
141 r = False 144 r = False
142 145
143 oldstdout = -1 146 oldstdout = -1
144 if _redirect: 147 if _redirect:
145 try: 148 try: