1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-21 22:32:41 +01:00

Fix arc diff in Subversion for non-English languages

Summary:
When using `arc diff`, this crash should not fire anymore on non-English shells:

    Undefined array key "Repository UUID"

The error message comes to this line:

https://we.phorge.it/source/arcanist/browse/master/src/repository/api/ArcanistSubversionAPI.php;f7fcf31c7e23475e345cb3cd4abf0474ba6fd9cf$606

Look at the parser of `svn info` that expects English language:

https://we.phorge.it/source/arcanist/browse/master/src/repository/api/ArcanistSubversionAPI.php;f7fcf31c7e23475e345cb3cd4abf0474ba6fd9cf$326-375

The historical behavior of `ExecFuture` is to inherit environment variables. It may have sense, to have the user home, etc.

So, the approach is to just clear the incompatible specific environment variable that alters the output language.

Closes T15855

Test Plan:
- clone a random a Subversion repository
- have your operating system in a non-English language
- (e.g. `export LANGUAGE=en_US:it_IT`)
- run 'arc diff'

No crash anymore. You are able to submit the patch, just like in git.

Reviewers: O1 Blessed Committers, l2dy, avivey

Reviewed By: O1 Blessed Committers, l2dy, avivey

Subscribers: l2dy, aklapper, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15855

Differential Revision: https://we.phorge.it/D25691
This commit is contained in:
Valerio Bozzolan 2024-07-08 10:03:25 +02:00
parent 331b255b15
commit 72e59da804

View file

@ -40,6 +40,12 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
$argv[0] = 'svn '.$argv[0]; $argv[0] = 'svn '.$argv[0];
$future = newv('ExecFuture', $argv); $future = newv('ExecFuture', $argv);
// For historical reasons we run Subversion commands keeping env.
// But, let's keep English, to have a reliable parser.
// https://we.phorge.it/T15872
$future->updateEnv('LC_ALL', 'C');
$future->setCWD($this->getPath()); $future->setCWD($this->getPath());
return $future; return $future;
} }