Show More
@@ -167,10 +167,14 b' def hook(ui, repo, name, throw=False, **' | |||
|
167 | 167 | if hname.split('.')[0] == name and cmd: |
|
168 | 168 | hooks.append((hname, cmd)) |
|
169 | 169 | |
|
170 |
re |
|
|
170 | res = runhooks(ui, repo, name, hooks, throw=throw, **args) | |
|
171 | r = False | |
|
172 | for hname, cmd in hooks: | |
|
173 | r = res[hname] or r | |
|
174 | return r | |
|
171 | 175 | |
|
172 | 176 | def runhooks(ui, repo, name, hooks, throw=False, **args): |
|
173 |
r = |
|
|
177 | res = {} | |
|
174 | 178 | oldstdout = -1 |
|
175 | 179 | |
|
176 | 180 | try: |
@@ -189,7 +193,7 b' def runhooks(ui, repo, name, hooks, thro' | |||
|
189 | 193 | pass |
|
190 | 194 | |
|
191 | 195 | if callable(cmd): |
|
192 |
r = _pythonhook(ui, repo, name, hname, cmd, args, throw) |
|
|
196 | r = _pythonhook(ui, repo, name, hname, cmd, args, throw) | |
|
193 | 197 | elif cmd.startswith('python:'): |
|
194 | 198 | if cmd.count(':') >= 2: |
|
195 | 199 | path, cmd = cmd[7:].rsplit(':', 1) |
@@ -204,9 +208,11 b' def runhooks(ui, repo, name, hooks, thro' | |||
|
204 | 208 | hookfn = getattr(mod, cmd) |
|
205 | 209 | else: |
|
206 | 210 | hookfn = cmd[7:].strip() |
|
207 |
r = _pythonhook(ui, repo, name, hname, hookfn, args, throw) |
|
|
211 | r = _pythonhook(ui, repo, name, hname, hookfn, args, throw) | |
|
208 | 212 | else: |
|
209 |
r = _exthook(ui, repo, hname, cmd, args, throw) |
|
|
213 | r = _exthook(ui, repo, hname, cmd, args, throw) | |
|
214 | ||
|
215 | res[hname] = r | |
|
210 | 216 | |
|
211 | 217 | # The stderr is fully buffered on Windows when connected to a pipe. |
|
212 | 218 | # A forcible flush is required to make small stderr data in the |
@@ -217,4 +223,4 b' def runhooks(ui, repo, name, hooks, thro' | |||
|
217 | 223 | os.dup2(oldstdout, stdoutno) |
|
218 | 224 | os.close(oldstdout) |
|
219 | 225 | |
|
220 | return r | |
|
226 | return res |
General Comments 0
You need to be logged in to leave comments.
Login now