Package org.apache.maven.scm.provider.hg
Class HgUtils
- java.lang.Object
-
- org.apache.maven.scm.provider.hg.HgUtils
-
public final class HgUtils extends Object
Common code for executing hg commands.- Author:
- thurner rupert
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
differentOutgoingBranchFound(File workingDir, String workingbranchName)
Check if there are outgoing changes on a different branch.static ScmResult
execute(File workingDir, String[] cmdAndArgs)
static ScmResult
execute(HgConsumer consumer, File workingDir, String[] cmdAndArgs)
static String[]
expandCommandLine(String[] cmdAndArgs, ScmFileSet additionalFiles)
static String
getCurrentBranchName(File workingDir)
static int
getCurrentRevisionNumber(File workingDir)
static String
maskPassword(org.codehaus.plexus.util.cli.Commandline cl)
-
-
-
Field Detail
-
DEFAULT
public static final String DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
public static ScmResult execute(HgConsumer consumer, File workingDir, String[] cmdAndArgs) throws ScmException
- Throws:
ScmException
-
execute
public static ScmResult execute(File workingDir, String[] cmdAndArgs) throws ScmException
- Throws:
ScmException
-
expandCommandLine
public static String[] expandCommandLine(String[] cmdAndArgs, ScmFileSet additionalFiles)
-
getCurrentRevisionNumber
public static int getCurrentRevisionNumber(File workingDir) throws ScmException
- Throws:
ScmException
-
getCurrentBranchName
public static String getCurrentBranchName(File workingDir) throws ScmException
- Throws:
ScmException
-
differentOutgoingBranchFound
public static boolean differentOutgoingBranchFound(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:
workingDir
- the working dirworkingbranchName
- the working branch name- Returns:
- true if a different outgoing branch was found
- Throws:
ScmException
- on outgoing command error
-
maskPassword
public static String maskPassword(org.codehaus.plexus.util.cli.Commandline cl)
-
-