[PATCH] subrepo: correct find fetch URL git repository in multilanguage system (issue5176)

Matt Mackall mpm at selenic.com
Sat Apr 16 16:13:05 EDT 2016


On Sat, 2016-04-16 at 11:22 +0300, Aidar Sayfullin wrote:
> # HG changeset patch
> # User Aidar Sayfullin <aidar at saifoulline.ru>
> # Date 1460794612 -10800
> #      Sat Apr 16 11:16:52 2016 +0300
> # Node ID e272b83b632f0cc444fd9b520d40c8744e13d076
> # Parent  d9539959167df7cb3acd08c4ab53d8e8a7f027cb
> subrepo: correct find fetch URL git repository in multilanguage system
> (issue5176)

This patch looks great, thanks for debugging this, but I think a better approach
is to simply set the language to C for -all- calls to Git:

diff -r 06d012fdfa4c mercurial/subrepo.py
--- a/mercurial/subrepo.py	Sat Apr 16 11:16:52 2016 +0300
+++ b/mercurial/subrepo.py	Sat Apr 16 15:10:30 2016 -0500
@@ -1387,6 +1387,8 @@
         self.ui.debug('%s: git %s\n' % (self._relpath, ' '.join(commands)))
         if env is None:
             env = os.environ.copy()
+        # disable localization for Git output (issue5176)
+        env['LC_ALL'] = 'C'
         # fix for Git CVE-2015-7545
         if 'GIT_ALLOW_PROTOCOL' not in env:
             env['GIT_ALLOW_PROTOCOL'] = 'file:git:http:https:ssh'

Then we won't be surprised by any more weird parsing problems. Turns out we
already have a similar fix in place for calling out to SVN in this file.
-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list