<orderEntry type="module" module-name="platform-api" />
<orderEntry type="module" module-name="vcs-impl" />
<orderEntry type="module" module-name="platform-impl" />
+ <orderEntry type="module" module-name="lang-api" />
</component>
</module>
package org.zmlx.hg4idea;
import com.intellij.concurrency.JobScheduler;
+import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diff.impl.patch.formove.FilePathComparator;
+import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.fileEditor.FileEditorManagerAdapter;
import com.intellij.openapi.fileEditor.FileEditorManagerEvent;
import com.intellij.openapi.fileEditor.FileEditorManagerListener;
import com.intellij.util.containers.Convertor;
import com.intellij.util.messages.MessageBusConnection;
import com.intellij.util.messages.Topic;
+import org.jetbrains.annotations.NotNull;
import org.zmlx.hg4idea.provider.*;
import org.zmlx.hg4idea.provider.annotate.HgAnnotationProvider;
import org.zmlx.hg4idea.provider.commit.HgCheckinEnvironment;
private ScheduledFuture<?> changesUpdaterScheduledFuture;
private final HgGlobalSettings globalSettings;
private final HgProjectSettings projectSettings;
+ private final ProjectLevelVcsManager myVcsManager;
private boolean started = false;
private HgVFSListener myVFSListener;
private VirtualFileListener myDirStateChangeListener;
public HgVcs(Project project,
- HgGlobalSettings globalSettings, HgProjectSettings projectSettings) {
+ HgGlobalSettings globalSettings, HgProjectSettings projectSettings,
+ ProjectLevelVcsManager vcsManager) {
super(project, VCS_NAME);
this.globalSettings = globalSettings;
this.projectSettings = projectSettings;
+ myVcsManager = vcsManager;
configurable = new HgProjectConfigurable(projectSettings);
changeProvider = new HgChangeProvider(project, getKeyInstanceMethod());
rollbackEnvironment = new HgRollbackEnvironment(project);
public HgGlobalSettings getGlobalSettings() {
return globalSettings;
}
+
+ public void showMessageInConsole(String message, final TextAttributes style) {
+ myVcsManager.addMessageToConsoleWindow(message, style);
+ }
+
+
}
// limitations under the License.
package org.zmlx.hg4idea.command;
+import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
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.*;
static final Logger LOG = Logger.getInstance(HgCommandService.class.getName());
- private static final List<String> DEFAULT_OPTIONS = Arrays.asList(
+ static final List<String> DEFAULT_OPTIONS = Arrays.asList(
"--config", "ui.merge=internal:merge"
);
@Nullable
HgCommandResult execute(VirtualFile repo, List<String> hgOptions,
String operation, List<String> arguments, Charset charset) {
+ return execute(repo, hgOptions, operation, arguments, charset, false);
+ }
+
+ HgCommandResult execute(VirtualFile repo, List<String> hgOptions,
+ String operation, List<String> arguments, Charset charset, boolean suppressCommandOutput) {
if (!validator.check(mySettings)) {
return null;
}
String warnings = warningReceiver.getWarnings();
result.setWarnings(warnings);
+
+ // logging to the Version Control console (without extensions and configs)
+ final String cmdString = String.format("%s %s %s", HgVcs.HG_EXECUTABLE_FILE_NAME, operation,
+ StringUtils.join(arguments, " "));
+ final HgVcs hgVcs = HgVcs.getInstance(myProject);
+ hgVcs.showMessageInConsole(cmdString, ConsoleViewContentType.USER_INPUT.getAttributes());
+ if (!suppressCommandOutput) {
+ hgVcs.showMessageInConsole(result.getRawOutput(), ConsoleViewContentType.SYSTEM_OUTPUT.getAttributes());
+ }
+ hgVcs.showMessageInConsole(result.getRawError(), ConsoleViewContentType.ERROR_OUTPUT.getAttributes());
+
return result;
}
import org.zmlx.hg4idea.HgRevisionNumber;
import java.io.File;
+import java.nio.charset.Charset;
import java.util.*;
public class HgStatusCommand {
arguments.add(file);
}
- HgCommandResult result = service.execute(repo, "status", arguments);
+ HgCommandResult result = service.execute(repo, HgCommandService.DEFAULT_OPTIONS, "status", arguments, Charset.defaultCharset(), true);
Set<HgChange> changes = new HashSet<HgChange>();
HgChange previous = null;
if (result == null) {