comparison mercurial/subrepo.py @ 10271:9b38bec5dc29

subrepo: make svn use C locale for portability My reasons to do c2e2a5e6c36b were wrong. We want to have non-localized svn output while preserving current locale for input arguments and svn internals. This is achieved by setting LC_MESSAGE=C.
author Patrick Mezard <pmezard@gmail.com>
date Thu, 21 Jan 2010 15:13:03 +0100
parents d6512b3e9ac0
children 886858b834da
comparison
equal deleted inserted replaced
10270:c2e27f7966a7 10271:9b38bec5dc29
263 def _svncommand(self, commands): 263 def _svncommand(self, commands):
264 cmd = ['svn'] + commands + [self._path] 264 cmd = ['svn'] + commands + [self._path]
265 cmd = [util.shellquote(arg) for arg in cmd] 265 cmd = [util.shellquote(arg) for arg in cmd]
266 cmd = util.quotecommand(' '.join(cmd)) 266 cmd = util.quotecommand(' '.join(cmd))
267 env = dict(os.environ) 267 env = dict(os.environ)
268 for k in ('LANGUAGE', 'LANG', 'LC_ALL', 'LC_MESSAGES'): 268 # Avoid localized output, preserve current locale for everything else.
269 env[k] = 'en_US.UTF-8' 269 env['LC_MESSAGES'] = 'C'
270 write, read, err = util.popen3(cmd, env=env, newlines=True) 270 write, read, err = util.popen3(cmd, env=env, newlines=True)
271 retdata = read.read() 271 retdata = read.read()
272 err = err.read().strip() 272 err = err.read().strip()
273 if err: 273 if err:
274 raise util.Abort(err) 274 raise util.Abort(err)