Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hook.py @ 37463:bbd240f81ac5
procutil: make explainexit() simply return a message (API)
Almost all callers want it.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 07 Apr 2018 21:23:42 +0900 |
parents | a8a902d7176e |
children | 483de34f23b1 |
comparison
equal
deleted
inserted
replaced
37462:c0d0fd87ba7c | 37463:bbd240f81ac5 |
---|---|
152 | 152 |
153 duration = util.timer() - starttime | 153 duration = util.timer() - starttime |
154 ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n', | 154 ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n', |
155 name, cmd, duration) | 155 name, cmd, duration) |
156 if r: | 156 if r: |
157 desc, r = procutil.explainexit(r) | 157 desc = procutil.explainexit(r) |
158 if throw: | 158 if throw: |
159 raise error.HookAbort(_('%s hook %s') % (name, desc)) | 159 raise error.HookAbort(_('%s hook %s') % (name, desc)) |
160 ui.warn(_('warning: %s hook %s\n') % (name, desc)) | 160 ui.warn(_('warning: %s hook %s\n') % (name, desc)) |
161 return r | 161 return r |
162 | 162 |