Mercurial > hg
comparison mercurial/subrepo.py @ 17705:6929b9c70be9 stable
subrepo: setting LC_MESSAGES only works if LC_ALL is empty or unset
For example LC_ALL=de_DE.utf-8 would cause the version check to fail,
because "svn, Version 1.6.12 (r955767)" with a capital "V" will be printed.
Using "svn --version --quiet" would only print the version number, but then
matching other messages, e.g. "Committed revision" would fail.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 04 Oct 2012 16:30:40 +0200 |
parents | cb12d3ce5607 |
children | 70efdc22b188 |
comparison
equal
deleted
inserted
replaced
17703:4a07d2ff7c66 | 17705:6929b9c70be9 |
---|---|
653 if filename is not None: | 653 if filename is not None: |
654 path = os.path.join(self._ctx._repo.origroot, self._path, filename) | 654 path = os.path.join(self._ctx._repo.origroot, self._path, filename) |
655 cmd.append(path) | 655 cmd.append(path) |
656 env = dict(os.environ) | 656 env = dict(os.environ) |
657 # Avoid localized output, preserve current locale for everything else. | 657 # Avoid localized output, preserve current locale for everything else. |
658 lc_all = env.get('LC_ALL') | |
659 if lc_all: | |
660 env['LANG'] = lc_all | |
661 del env['LC_ALL'] | |
658 env['LC_MESSAGES'] = 'C' | 662 env['LC_MESSAGES'] = 'C' |
659 p = subprocess.Popen(cmd, bufsize=-1, close_fds=util.closefds, | 663 p = subprocess.Popen(cmd, bufsize=-1, close_fds=util.closefds, |
660 stdout=subprocess.PIPE, stderr=subprocess.PIPE, | 664 stdout=subprocess.PIPE, stderr=subprocess.PIPE, |
661 universal_newlines=True, env=env, **extrakw) | 665 universal_newlines=True, env=env, **extrakw) |
662 stdout, stderr = p.communicate() | 666 stdout, stderr = p.communicate() |