MercurialPlugin: Reuse vcsSynchronousExec()

Passing ForceCLocale sets the LANGUAGE env var to C.

Change-Id: I7317aeeeb95bfbc5e3fa5fb97fb4f243daaa1f7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-09-02 18:27:14 +02:00
parent 824ff8f9ca
commit d26dd8d641

View File

@@ -141,14 +141,8 @@ bool MercurialClient::synchronousPull(const FilePath &workingDir, const QString
QStringList args; QStringList args;
args << vcsCommandString(PullCommand) << extraOptions << srcLocation; args << vcsCommandString(PullCommand) << extraOptions << srcLocation;
// cause mercurial doesn`t understand LANG const CommandResult result = vcsSynchronousExec(workingDir, args,
Environment env = Environment::systemEnvironment(); VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage | VcsCommand::ForceCLocale);
env.set("LANGUAGE", "C");
VcsCommand *command = VcsBaseClient::createVcsCommand(workingDir, env);
command->addFlags(VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage);
const CommandResult result = command->runCommand({vcsBinary(), args}, vcsTimeoutS());
delete command;
parsePullOutput(result.cleanedStdOut().trimmed()); parsePullOutput(result.cleanedStdOut().trimmed());
return result.result() == ProcessResult::FinishedWithSuccess; return result.result() == ProcessResult::FinishedWithSuccess;