HgCommandExecutor: use File.separator, not slash
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Thu, 14 Apr 2011 10:47:58 +0000 (14:47 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Mon, 18 Apr 2011 09:15:02 +0000 (13:15 +0400)
plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java

index b7f9cbc9cf0f7906c60d75ca146b2b902e47d427..0eafde5b7244c9bf754d61830b757d26267f6765 100644 (file)
@@ -20,13 +20,17 @@ import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.vcsUtil.VcsUtil;
 import org.apache.commons.lang.StringUtils;
 import org.jetbrains.annotations.Nullable;
-import org.zmlx.hg4idea.*;
+import org.zmlx.hg4idea.HgExecutableValidator;
+import org.zmlx.hg4idea.HgGlobalSettings;
+import org.zmlx.hg4idea.HgVcs;
+import org.zmlx.hg4idea.HgVcsMessages;
 import org.zmlx.hg4idea.util.HgErrorUtil;
 
 import javax.swing.*;
 import java.awt.*;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
+import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.net.Socket;
@@ -182,7 +186,7 @@ public final class HgCommandExecutor {
   // logging to the Version Control console (without extensions and configs)
   private void log(String operation, List<String> arguments, HgCommandResult result) {
     String exeName;
-    final int lastSlashIndex = mySettings.getHgExecutable().lastIndexOf("/");
+    final int lastSlashIndex = mySettings.getHgExecutable().lastIndexOf(File.separator);
     exeName = mySettings.getHgExecutable().substring(lastSlashIndex + 1);
 
     final String executable = mySettings.isRunViaBash() ? "bash -c " + exeName : exeName;