org.apache.maven.scm.provider.accurev.cli
Class AccuRevCommandLine

java.lang.Object
  extended by org.apache.maven.scm.provider.accurev.cli.AccuRevCommandLine
All Implemented Interfaces:
AccuRev

public class AccuRevCommandLine
extends Object
implements AccuRev


Field Summary
 
Fields inherited from interface org.apache.maven.scm.provider.accurev.AccuRev
ACCUREV_TIME_FORMAT_STRING, ACCUREV_TIME_SPEC, DEFAULT_ACCUREV_EXECUTABLE, DEFAULT_ADD_MESSAGE, DEFAULT_PORT, DEFAULT_PROMOTE_MESSAGE, DEFAULT_REMOVE_MESSAGE
 
Constructor Summary
AccuRevCommandLine()
           
AccuRevCommandLine(String host, int port)
           
 
Method Summary
 List<File> add(File basedir, List<File> elements, String message)
          Add the file to the repository.
 List<BlameLine> annotate(File basedir, File file)
          AccuRev annotate an element
 boolean chws(File basedir, String workSpaceName, String newBasisStream)
          Relocate/reparent a workspace
 List<File> defunct(File basedir, List<File> files, String message)
          Remove the file from the repository.
 List<FileDifference> diff(String baseStream, String fromTimeSpec, String toTimeSpec)
          AccuRev differences of a stream between to timespecs
protected  int executeCommandLine(Commandline cl, InputStream stdin, CommandOutputConsumer stdout, StreamConsumer stderr)
          Extracted so test class can override
 String getClientVersion()
           
protected  Commandline getCommandline()
           
 String getCommandLines()
          The accurev command line strings since last reset(), separated by ";"
 String getErrorOutput()
          Full output of accurev command line invocations since reset
 String getExecutable()
           
 ScmLogger getLogger()
           
 List<Transaction> history(String baseStream, String fromTimeSpec, String toTimeSpec, int count, boolean depotHistory, boolean transactionsOnly)
           
 AccuRevInfo info(File basedir)
          Get info about the current logged in user for the current workspace.
 boolean login(String user, String password)
          Logins in as the given user, retains authtoken for use with subsequent commands.
 boolean logout()
           
 boolean mkdepot(String depotName)
           
 boolean mksnap(String snapShotName, String basisStream)
           
 boolean mkstream(String backingStream, String newStreamName)
           
 boolean mkws(String basisStream, String workspaceName, File basedir)
          Make workspace
 List<File> pop(File basedir, Collection<File> elements)
          Re populate missing files to existing workspace.
 List<File> popExternal(File basedir, String versionSpec, String tranSpec, Collection<File> elements)
          Populate external to a workspace a (stream) and transactionId/time, to a specific location.
 List<File> promote(File basedir, List<File> files, String message)
           
 List<File> promoteAll(File baseDir, String commitMessage)
          Any elements that have been kept previously or are currently modified will be promoted.
 boolean promoteStream(String subStream, String commitMessage, List<File> promotedFiles)
           
 boolean reactivate(String workSpaceName)
          Reactivate a workspace
 void reset()
          Reset command process, clear command output accumulators
 boolean rmws(String workSpaceName)
          Deactivate a workspace
 void setExecutable(String accuRevExe)
           
 void setLogger(ScmLogger logger)
           
 void setServer(String host, int port)
           
 Map<String,WorkSpace> showRefTrees()
           
 Stream showStream(String stream)
           
 Map<String,WorkSpace> showWorkSpaces()
           
 String stat(File element)
          Accurev status of an element
 List<File> stat(File basedir, Collection<File> elements, AccuRevStat statType)
           
 CategorisedElements statBackingStream(File basedir, Collection<File> elements)
          Sorts list of elements by whether they exist in the backing stream or not.
 List<File> statTag(String streamName)
           
 boolean syncReplica()
           
 List<File> update(File baseDir, String transactionId)
          Update a workspace or reftree, to a particular transaction id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccuRevCommandLine

public AccuRevCommandLine()

AccuRevCommandLine

public AccuRevCommandLine(String host,
                          int port)
Method Detail

setServer

public void setServer(String host,
                      int port)

setExecutable

public void setExecutable(String accuRevExe)

executeCommandLine

protected int executeCommandLine(Commandline cl,
                                 InputStream stdin,
                                 CommandOutputConsumer stdout,
                                 StreamConsumer stderr)
                          throws CommandLineException
Extracted so test class can override

Parameters:
stdin -
stdout -
stderr -
Returns:
Throws:
CommandLineException

getCommandline

protected Commandline getCommandline()

reset

public void reset()
Description copied from interface: AccuRev
Reset command process, clear command output accumulators

Specified by:
reset in interface AccuRev

mkws

public boolean mkws(String basisStream,
                    String workspaceName,
                    File basedir)
             throws AccuRevException
Make workspace

Specified by:
mkws in interface AccuRev
Returns:
Throws:
AccuRevException

update

public List<File> update(File baseDir,
                         String transactionId)
                  throws AccuRevException
Update a workspace or reftree, to a particular transaction id

Specified by:
update in interface AccuRev
Returns:
Throws:
AccuRevException

add

public List<File> add(File basedir,
                      List<File> elements,
                      String message)
               throws AccuRevException
Add the file to the repository. File must be within a workspace

Specified by:
add in interface AccuRev
Parameters:
basedir - base directory of the workspace
elements - to add (relative to basedir, or absolute)
message - the commit message
Throws:
AccuRevException

defunct

public List<File> defunct(File basedir,
                          List<File> files,
                          String message)
                   throws AccuRevException
Description copied from interface: AccuRev
Remove the file from the repository. Files must be within a workspace

Specified by:
defunct in interface AccuRev
Returns:
Throws:
AccuRevException

promote

public List<File> promote(File basedir,
                          List<File> files,
                          String message)
                   throws AccuRevException
Specified by:
promote in interface AccuRev
Throws:
AccuRevException

getCommandLines

public String getCommandLines()
Description copied from interface: AccuRev
The accurev command line strings since last reset(), separated by ";"

Specified by:
getCommandLines in interface AccuRev
Returns:

getErrorOutput

public String getErrorOutput()
Description copied from interface: AccuRev
Full output of accurev command line invocations since reset

Specified by:
getErrorOutput in interface AccuRev
Returns:

setLogger

public void setLogger(ScmLogger logger)

getLogger

public ScmLogger getLogger()

mkdepot

public boolean mkdepot(String depotName)
                throws AccuRevException
Throws:
AccuRevException

mkstream

public boolean mkstream(String backingStream,
                        String newStreamName)
                 throws AccuRevException
Throws:
AccuRevException

promoteStream

public boolean promoteStream(String subStream,
                             String commitMessage,
                             List<File> promotedFiles)
                      throws AccuRevException
Throws:
AccuRevException

promoteAll

public List<File> promoteAll(File baseDir,
                             String commitMessage)
                      throws AccuRevException
Any elements that have been kept previously or are currently modified will be promoted.

Specified by:
promoteAll in interface AccuRev
Parameters:
baseDir - - location of the workspace to act on
Returns:
Throws:
AccuRevException

info

public AccuRevInfo info(File basedir)
                 throws AccuRevException
Description copied from interface: AccuRev
Get info about the current logged in user for the current workspace.

Specified by:
info in interface AccuRev
Returns:
Throws:
AccuRevException

reactivate

public boolean reactivate(String workSpaceName)
                   throws AccuRevException
Description copied from interface: AccuRev
Reactivate a workspace

Specified by:
reactivate in interface AccuRev
Parameters:
workSpaceName - full name of the workspace, including the user suffix
Returns:
Throws:
AccuRevException

rmws

public boolean rmws(String workSpaceName)
             throws AccuRevException
Description copied from interface: AccuRev
Deactivate a workspace

Specified by:
rmws in interface AccuRev
Parameters:
workSpaceName - full name of the workspace, including the user suffix
Returns:
Throws:
AccuRevException

stat

public String stat(File element)
            throws AccuRevException
Description copied from interface: AccuRev
Accurev status of an element

Specified by:
stat in interface AccuRev
Returns:
null if ignored or not in workspace
Throws:
AccuRevException

chws

public boolean chws(File basedir,
                    String workSpaceName,
                    String newBasisStream)
             throws AccuRevException
Description copied from interface: AccuRev
Relocate/reparent a workspace

Specified by:
chws in interface AccuRev
workSpaceName - (full workspacename including user)
Returns:
Throws:
AccuRevException

mksnap

public boolean mksnap(String snapShotName,
                      String basisStream)
               throws AccuRevException
Specified by:
mksnap in interface AccuRev
Throws:
AccuRevException

statTag

public List<File> statTag(String streamName)
                   throws AccuRevException
Specified by:
statTag in interface AccuRev
Throws:
AccuRevException

stat

public List<File> stat(File basedir,
                       Collection<File> elements,
                       AccuRevStat statType)
                throws AccuRevException
Specified by:
stat in interface AccuRev
elements - list of elements to stat, relative to basedir
Returns:
Throws:
AccuRevException

pop

public List<File> pop(File basedir,
                      Collection<File> elements)
               throws AccuRevException
Description copied from interface: AccuRev
Re populate missing files to existing workspace.

Specified by:
pop in interface AccuRev
Returns:
Throws:
AccuRevException

popExternal

public List<File> popExternal(File basedir,
                              String versionSpec,
                              String tranSpec,
                              Collection<File> elements)
                       throws AccuRevException
Description copied from interface: AccuRev
Populate external to a workspace a (stream) and transactionId/time, to a specific location.

You must check AccuRevCapability.POPULATE_TO_TRANSACTION before passing a tranid/time to this method. If not supported should pass "now","highest" or null for tranSpec

Specified by:
popExternal in interface AccuRev
versionSpec - stream to update to
tranSpec - transaction to update to or "now" if not supported.
elements - (must be depot relative. if null "/./" root is used)
Returns:
Throws:
AccuRevException

statBackingStream

public CategorisedElements statBackingStream(File basedir,
                                             Collection<File> elements)
                                      throws AccuRevException
Description copied from interface: AccuRev
Sorts list of elements by whether they exist in the backing stream or not.

Specified by:
statBackingStream in interface AccuRev
Returns:
Throws:
AccuRevException

history

public List<Transaction> history(String baseStream,
                                 String fromTimeSpec,
                                 String toTimeSpec,
                                 int count,
                                 boolean depotHistory,
                                 boolean transactionsOnly)
                          throws AccuRevException
Specified by:
history in interface AccuRev
Throws:
AccuRevException

diff

public List<FileDifference> diff(String baseStream,
                                 String fromTimeSpec,
                                 String toTimeSpec)
                          throws AccuRevException
Description copied from interface: AccuRev
AccuRev differences of a stream between to timespecs

Specified by:
diff in interface AccuRev
Returns:
Throws:
AccuRevException

login

public boolean login(String user,
                     String password)
              throws AccuRevException
Description copied from interface: AccuRev
Logins in as the given user, retains authtoken for use with subsequent commands.

Specified by:
login in interface AccuRev
Returns:
Throws:
AccuRevException

logout

public boolean logout()
               throws AccuRevException
Throws:
AccuRevException

annotate

public List<BlameLine> annotate(File basedir,
                                File file)
                         throws AccuRevException
Description copied from interface: AccuRev
AccuRev annotate an element

Specified by:
annotate in interface AccuRev
Returns:
Throws:
AccuRevException

showRefTrees

public Map<String,WorkSpace> showRefTrees()
                                   throws AccuRevException
Specified by:
showRefTrees in interface AccuRev
Throws:
AccuRevException

showWorkSpaces

public Map<String,WorkSpace> showWorkSpaces()
                                     throws AccuRevException
Specified by:
showWorkSpaces in interface AccuRev
Throws:
AccuRevException

showStream

public Stream showStream(String stream)
                  throws AccuRevException
Specified by:
showStream in interface AccuRev
Throws:
AccuRevException

getExecutable

public String getExecutable()
Specified by:
getExecutable in interface AccuRev

getClientVersion

public String getClientVersion()
                        throws AccuRevException
Specified by:
getClientVersion in interface AccuRev
Throws:
AccuRevException

syncReplica

public boolean syncReplica()
                    throws AccuRevException
Specified by:
syncReplica in interface AccuRev
Throws:
AccuRevException


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