From eb7d6c5e3b91e603c52df8f193daed1a4af10b25 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 14 Apr 2011 10:48:36 +0400 Subject: [PATCH] [hg] Show actual executable in the command line (not hg.exe for hg.bat, for instance). --- .../src/org/zmlx/hg4idea/execution/HgCommandExecutor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java index 0b974bfa4c74..b7f9cbc9cf0f 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java @@ -181,7 +181,11 @@ public final class HgCommandExecutor { // logging to the Version Control console (without extensions and configs) private void log(String operation, List 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