From d26dd8d641dd59ed169178454f59ebb266544b1a Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 2 Sep 2022 18:27:14 +0200 Subject: [PATCH] MercurialPlugin: Reuse vcsSynchronousExec() Passing ForceCLocale sets the LANGUAGE env var to C. Change-Id: I7317aeeeb95bfbc5e3fa5fb97fb4f243daaa1f7e Reviewed-by: Orgad Shaneh Reviewed-by: --- src/plugins/mercurial/mercurialclient.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index f7d4cbb751c..338308378e1 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -141,14 +141,8 @@ bool MercurialClient::synchronousPull(const FilePath &workingDir, const QString QStringList args; args << vcsCommandString(PullCommand) << extraOptions << srcLocation; - // cause mercurial doesn`t understand LANG - Environment env = Environment::systemEnvironment(); - 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; + const CommandResult result = vcsSynchronousExec(workingDir, args, + VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage | VcsCommand::ForceCLocale); parsePullOutput(result.cleanedStdOut().trimmed()); return result.result() == ProcessResult::FinishedWithSuccess;