org.apache.maven.scm.provider.hg
Class HgUtils

java.lang.Object
  extended by org.apache.maven.scm.provider.hg.HgUtils

public final class HgUtils
extends Object

Common code for executing hg commands.

Version:
$Id: HgUtils.java 1378723 2012-08-29 20:57:26Z hboutemy $
Author:
thurner rupert

Method Summary
static boolean differentOutgoingBranchFound(ScmLogger logger, 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, ScmLogger logger, File workingDir, String[] cmdAndArgs)
           
static String[] expandCommandLine(String[] cmdAndArgs, ScmFileSet additionalFiles)
           
static String getCurrentBranchName(ScmLogger logger, File workingDir)
           
static int getCurrentRevisionNumber(ScmLogger logger, File workingDir)
           
static String maskPassword(Commandline cl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

execute

public static ScmResult execute(HgConsumer consumer,
                                ScmLogger logger,
                                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(ScmLogger logger,
                                           File workingDir)
                                    throws ScmException
Throws:
ScmException

getCurrentBranchName

public static String getCurrentBranchName(ScmLogger logger,
                                          File workingDir)
                                   throws ScmException
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 found

Method users should not stop the push on a negative return, instead, they should hg push -r(branch being released)

Parameters:
logger - the logger
workingDir - the working dir
workingbranchName - the working branch name
Returns:
true if a different outgoing branch was found
Throws:
ScmException - on outgoing command error

maskPassword

public static String maskPassword(Commandline cl)


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.