[hg] Show actual executable in the command line (not hg.exe for hg.bat, for instance). idea/106.484
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Thu, 14 Apr 2011 06:48:36 +0000 (10:48 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Thu, 14 Apr 2011 06:52:04 +0000 (10:52 +0400)
plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java

index 0b974bfa4c7406918f1bccacaeee2f2e3217c7df..b7f9cbc9cf0f7906c60d75ca146b2b902e47d427 100644 (file)
@@ -181,7 +181,11 @@ public final class HgCommandExecutor {
 
   // logging to the Version Control console (without extensions and configs)
   private void log(String operation, List<String> arguments, HgCommandResult result) {
-    final String executable = mySettings.isRunViaBash() ? "bash -c " + HgVcs.HG_EXECUTABLE_FILE_NAME : HgVcs.HG_EXECUTABLE_FILE_NAME;
+    String exeName;
+    final int lastSlashIndex = mySettings.getHgExecutable().lastIndexOf("/");
+    exeName = mySettings.getHgExecutable().substring(lastSlashIndex + 1);
+
+    final String executable = mySettings.isRunViaBash() ? "bash -c " + exeName : exeName;
     final String cmdString = String.format("%s %s %s", executable, operation, StringUtils.join(arguments, " "));
 
     // log command