From 5cad53fa66e829024072197ce13a0bbd7287d033 Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Wed, 22 Oct 2014 19:29:46 +0400 Subject: [PATCH] 118571 Fixed setting locale for svn command line client - "LC_ALL" variable is set to configured locale, "LANGUAGE" variable is cleared (to use english output, if localization files for configured locale are not found) --- .../idea/svn/commandLine/CommandExecutor.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandExecutor.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandExecutor.java index cdca82de6966..e00b8f1e3183 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandExecutor.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandExecutor.java @@ -75,8 +75,7 @@ public class CommandExecutor { public CommandExecutor(@NotNull @NonNls String exePath, @NotNull Command command) { myCommand = command; myResultBuilder = command.getResultBuilder(); - if (myResultBuilder != null) - { + if (myResultBuilder != null) { myListeners.addListener(myResultBuilder); // cancel tracker should be executed after result builder myListeners.addListener(new CommandCancelTracker()); @@ -160,12 +159,13 @@ public class CommandExecutor { private void setupLocale() { String locale = Registry.stringValue("svn.executable.locale"); - Map environment = myCommandLine.getEnvironment(); - // TODO: check if we need to set LC_ALL to configured locale or just clear it - environment.put("LC_ALL", ""); - environment.put("LC_MESSAGES", locale); - environment.put("LANG", locale); + if (!StringUtil.isEmpty(locale)) { + Map environment = myCommandLine.getEnvironment(); + + environment.put("LANGUAGE", ""); + environment.put("LC_ALL", locale); + } } private void ensureMessageFile() throws SvnBindException { @@ -413,7 +413,7 @@ public class CommandExecutor { * @throws IllegalStateException if process has not been started */ protected void checkStarted() { - if (! isStarted()) { + if (!isStarted()) { throw new IllegalStateException("The process is not started yet"); } }