Class HgConsumer

java.lang.Object
org.apache.maven.scm.util.AbstractConsumer
org.apache.maven.scm.provider.hg.command.HgConsumer
All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer
Direct Known Subclasses:
HgAddConsumer, HgBlameConsumer, HgChangeLogConsumer, HgCheckOutConsumer, HgConfig.HgVersionConsumer, HgDiffConsumer, HgInfoConsumer, HgListConsumer, HgOutgoingConsumer, HgRemoveConsumer, HgStatusConsumer, HgTagConsumer, HgUtils.HgBranchnameConsumer, HgUtils.HgRevNoConsumer

public class HgConsumer extends AbstractConsumer
Base consumer to do common parsing for all hg commands.

More specific: log line each line if debug is enabled, get file status and detect warnings from hg

  • Field Details

    • IDENTIFIERS

      private static final Map<String,ScmFileStatus> IDENTIFIERS
      A list of known keywords from hg
    • MESSAGES

      private static final Map<String,String> MESSAGES
      A list of known message prefixes from hg
    • MAX_STDERR_SIZE

      private static final int MAX_STDERR_SIZE
      Number of lines to keep from Std.Err This size is set to ensure that we capture enough info but still keeps a low memory footprint.
      See Also:
    • stderr

      private final List<String> stderr
      A list of the MAX_STDERR_SIZE last errors or warnings.
  • Constructor Details

    • HgConsumer

      public HgConsumer(ScmLogger logger)
  • Method Details

    • doConsume

      public void doConsume(ScmFileStatus status, String trimmedLine)
    • consumeLine

      public void consumeLine(String line)
    • getStdErr

      public String getStdErr()
      Warnings and errors is usually printed out in Std.Err, thus for derived consumers operating on Std.Out this would typically return an empty string.
      Returns:
      Return the last lines interpreted as an warning or an error
    • processInputForKnownIdentifiers

      private static String processInputForKnownIdentifiers(String line)
    • processInputForKnownMessages

      private boolean processInputForKnownMessages(String line)