comparison mercurial/hook.py @ 39823:24e493ec2229

py3: rename pycompat.getcwd() to encoding.getcwd() (API) We need to avoid os.getcwdb() on Windows to avoid DeprecationWarnings, and we need encoding.strtolocal() to encode the result of os.getcwd().
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 21 Sep 2018 19:48:23 -0400
parents f9b2d996ffa5
children 8c8fcb385c46
comparison
equal deleted inserted replaced
39822:94c25f694ec3 39823:24e493ec2229
148 ui.note(_("running hook %s: %s\n") % (name, cmd)) 148 ui.note(_("running hook %s: %s\n") % (name, cmd))
149 149
150 if repo: 150 if repo:
151 cwd = repo.root 151 cwd = repo.root
152 else: 152 else:
153 cwd = pycompat.getcwd() 153 cwd = encoding.getcwd()
154 r = ui.system(cmd, environ=env, cwd=cwd, blockedtag='exthook-%s' % (name,)) 154 r = ui.system(cmd, environ=env, cwd=cwd, blockedtag='exthook-%s' % (name,))
155 155
156 duration = util.timer() - starttime 156 duration = util.timer() - starttime
157 ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n', 157 ui.log('exthook', 'exthook-%s: %s finished in %0.2f seconds\n',
158 name, cmd, duration) 158 name, cmd, duration)