Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/subrepo.py @ 10199:c2e2a5e6c36b
subrepo: force en_US.UTF-8 locale when calling svn
Parser only knows about en_US output. Forcing the encoding to UTF-8 might not
be the best thing to do since the caller may receive some of the subversion
output, but at least it should prevent conversion errors from svn client.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 02 Jan 2010 16:42:00 +0100 |
parents | 29e3c4a7699b |
children | 192c39586787 |
comparison
equal
deleted
inserted
replaced
10198:c2168d170f05 | 10199:c2e2a5e6c36b |
---|---|
259 | 259 |
260 def _svncommand(self, commands): | 260 def _svncommand(self, commands): |
261 cmd = ['svn'] + commands + [self._path] | 261 cmd = ['svn'] + commands + [self._path] |
262 cmd = [util.shellquote(arg) for arg in cmd] | 262 cmd = [util.shellquote(arg) for arg in cmd] |
263 cmd = util.quotecommand(' '.join(cmd)) | 263 cmd = util.quotecommand(' '.join(cmd)) |
264 write, read, err = util.popen3(cmd, newlines=True) | 264 env = dict(os.environ) |
265 for k in ('LANGUAGE', 'LANG', 'LC_ALL', 'LC_MESSAGES'): | |
266 env[k] = 'en_US.UTF-8' | |
267 write, read, err = util.popen3(cmd, env=env, newlines=True) | |
265 retdata = read.read() | 268 retdata = read.read() |
266 err = err.read().strip() | 269 err = err.read().strip() |
267 if err: | 270 if err: |
268 raise util.Abort(err) | 271 raise util.Abort(err) |
269 return retdata | 272 return retdata |