Package org.apache.maven.scm.provider.hg
Class HgUtils
java.lang.Object
org.apache.maven.scm.provider.hg.HgUtils
Common code for executing hg commands.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Get current (working) branch nameprivate static class
Get current (working) revision. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Default exit codes for entries not in exitCodeMapMap between command and its valid exit codes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static org.codehaus.plexus.util.cli.Commandline
static boolean
differentOutgoingBranchFound
(ScmLogger logger, File workingDir, String workingbranchName) Check if there are outgoing changes on a different branch.static ScmResult
static ScmResult
execute
(HgConsumer consumer, ScmLogger logger, File workingDir, String[] cmdAndArgs) (package private) static int
executeCmd
(HgConsumer consumer, org.codehaus.plexus.util.cli.Commandline cmd) static String[]
expandCommandLine
(String[] cmdAndArgs, ScmFileSet additionalFiles) private static String
getBranchName
(String branch) static String
getCurrentBranchName
(ScmLogger logger, File workingDir) static int
getCurrentRevisionNumber
(ScmLogger logger, File workingDir) static String
maskPassword
(org.codehaus.plexus.util.cli.Commandline cl)
-
Field Details
-
DEFAULT
- See Also:
-
EXIT_CODE_MAP
Map between command and its valid exit codes -
DEFAULT_EXIT_CODES
Default exit codes for entries not in exitCodeMap
-
-
Constructor Details
-
HgUtils
private HgUtils()
-
-
Method Details
-
execute
public static ScmResult execute(HgConsumer consumer, ScmLogger logger, File workingDir, String[] cmdAndArgs) throws ScmException - Throws:
ScmException
-
buildCmd
static org.codehaus.plexus.util.cli.Commandline buildCmd(File workingDir, String[] cmdAndArgs) throws ScmException - Throws:
ScmException
-
executeCmd
static int executeCmd(HgConsumer consumer, org.codehaus.plexus.util.cli.Commandline cmd) throws ScmException - Throws:
ScmException
-
execute
- Throws:
ScmException
-
expandCommandLine
-
getCurrentRevisionNumber
- Throws:
ScmException
-
getCurrentBranchName
- Throws:
ScmException
-
differentOutgoingBranchFound
public static boolean differentOutgoingBranchFound(ScmLogger logger, File workingDir, String workingbranchName) throws ScmException Check if there are outgoing changes on a different branch. If so, Mercurial default behaviour is to block the push and warn using a 'push creates new remote branch !' message. We also warn, and return true if a different outgoing branch was foundMethod users should not stop the push on a negative return, instead, they should hg push -r(branch being released)
- Parameters:
logger
- the logger31workingDir
- the working dirworkingbranchName
- the working branch name- Returns:
- true if a different outgoing branch was found
- Throws:
ScmException
- on outgoing command error
-
getBranchName
-
maskPassword
-