~sandy-carter/bzr4idea/compile_errors

« back to all changes in this revision

Viewing changes to src/bzr4idea/commands/GitLineHandler.java

  • Committer: Sandy Carter
  • Date: 2013-12-12 04:54:06 UTC
  • Revision ID: sandy.carter@savoirfairelinux.com-20131212045406-sg12azu8wpnb69y5
Work on Bzr Commands class

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import com.intellij.execution.process.ProcessOutputTypes;
19
19
import com.intellij.openapi.project.Project;
20
20
import com.intellij.openapi.util.Key;
 
21
import com.intellij.openapi.util.text.StringUtil;
 
22
import com.intellij.openapi.vcs.LineHandlerHelper;
21
23
import com.intellij.openapi.vfs.VirtualFile;
22
24
import com.intellij.util.EventDispatcher;
23
25
import org.jetbrains.annotations.NotNull;
30
32
/**
31
33
 * The handler that is based on per-line processing of the text.
32
34
 */
33
 
public class GitLineHandler extends GitHandler {
 
35
public class GitLineHandler extends GitTextHandler {
34
36
  /**
35
37
   * the partial line from stdout stream
36
38
   */
52
54
   * @param command   a command to execute
53
55
   */
54
56
  @SuppressWarnings({"WeakerAccess"})
55
 
  public GitLineHandler(@NotNull Project project, @NotNull File directory, @NotNull String command) {
 
57
  public GitLineHandler(@NotNull Project project, @NotNull File directory, @NotNull GitCommand command) {
56
58
    super(project, directory, command);
57
59
  }
58
60
 
63
65
   * @param vcsRoot a process directory
64
66
   * @param command a command to execute
65
67
   */
66
 
  public GitLineHandler(@NotNull final Project project, @NotNull final VirtualFile vcsRoot, @NotNull final String command) {
 
68
  public GitLineHandler(@NotNull final Project project, @NotNull final VirtualFile vcsRoot, @NotNull final GitCommand command) {
67
69
    super(project, vcsRoot, command);
68
70
  }
69
71
 
142
144
   * @param outputType output type
143
145
   */
144
146
  private void notifyLine(final String line, final Key outputType) {
145
 
    String trimmed = trimLineSeparator(line);
 
147
    String trimmed = LineHandlerHelper.trimLineSeparator(line);
146
148
    // if line ends with return, then it is a progress line, ignore it
147
149
    if (myVcs != null && !"\r".equals(line.substring(trimmed.length()))) {
148
 
      if (outputType == ProcessOutputTypes.STDOUT && !isStdoutSuppressed()) {
 
150
      if (outputType == ProcessOutputTypes.STDOUT && !isStdoutSuppressed() && !mySilent && !StringUtil.isEmptyOrSpaces(line)) {
149
151
        myVcs.showMessages(trimmed);
 
152
        LOG.info(line.trim());
150
153
      }
151
 
      else if (outputType == ProcessOutputTypes.STDERR && !isStderrSuppressed()) {
 
154
      else if (outputType == ProcessOutputTypes.STDERR && !isStderrSuppressed() && !mySilent && !StringUtil.isEmptyOrSpaces(line)) {
152
155
        myVcs.showErrorMessages(trimmed);
 
156
        LOG.info(line.trim());
 
157
      }
 
158
      else {
 
159
        LOG.debug(line.trim());
153
160
      }
154
161
    }
155
 
    myLineListeners.getMulticaster().onLineAvaiable(trimmed, outputType);
 
162
    myLineListeners.getMulticaster().onLineAvailable(trimmed, outputType);
156
163
  }
157
164
 
158
165
  /**