Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hook.py @ 37123:a8a902d7176e
procutil: bulk-replace function calls to point to new module
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 24 Mar 2018 15:10:51 +0900 |
parents | d4a2e0d5d042 |
children | bbd240f81ac5 |
comparison
equal
deleted
inserted
replaced
37122:d4a2e0d5d042 | 37123:a8a902d7176e |
---|---|
42 raise error.HookLoadError( | 42 raise error.HookLoadError( |
43 _('%s hook is invalid: "%s" not in a module') | 43 _('%s hook is invalid: "%s" not in a module') |
44 % (hname, funcname)) | 44 % (hname, funcname)) |
45 modname = funcname[:d] | 45 modname = funcname[:d] |
46 oldpaths = sys.path | 46 oldpaths = sys.path |
47 if util.mainfrozen(): | 47 if procutil.mainfrozen(): |
48 # binary installs require sys.path manipulation | 48 # binary installs require sys.path manipulation |
49 modpath, modfile = os.path.split(modname) | 49 modpath, modfile = os.path.split(modname) |
50 if modpath and modfile: | 50 if modpath and modfile: |
51 sys.path = sys.path[:] + [modpath] | 51 sys.path = sys.path[:] + [modpath] |
52 modname = modfile | 52 modname = modfile |
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 = util.explainexit(r) | 157 desc, r = 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 |