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 java.lang.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(java.lang.String host, int port)
           
 
Method Summary
 java.util.List<java.io.File> add(java.io.File basedir, java.util.List<java.io.File> elements, java.lang.String message)
          Add the file to the repository.
 java.util.List<BlameLine> annotate(java.io.File basedir, java.io.File file)
          AccuRev annotate an element
 boolean chws(java.io.File basedir, java.lang.String workSpaceName, java.lang.String newBasisStream)
          Relocate/reparent a workspace
 java.util.List<java.io.File> defunct(java.io.File basedir, java.util.List<java.io.File> files, java.lang.String message)
          Remove the file from the repository.
 java.util.List<FileDifference> diff(java.lang.String baseStream, java.lang.String fromTimeSpec, java.lang.String toTimeSpec)
          AccuRev differences of a stream between to timespecs
protected  int executeCommandLine(org.codehaus.plexus.util.cli.Commandline cl, java.io.InputStream stdin, CommandOutputConsumer stdout, org.codehaus.plexus.util.cli.StreamConsumer stderr)
          Extracted so test class can override
 java.lang.String getClientVersion()
           
protected  org.codehaus.plexus.util.cli.Commandline getCommandline()
           
 java.lang.String getCommandLines()
          The accurev command line strings since last reset(), separated by ";"
 java.lang.String getErrorOutput()
          Full output of accurev command line invocations since reset
 java.lang.String getExecutable()
           
 ScmLogger getLogger()
           
 java.util.List<Transaction> history(java.lang.String baseStream, java.lang.String fromTimeSpec, java.lang.String toTimeSpec, int count, boolean depotHistory, boolean transactionsOnly)
           
 AccuRevInfo info(java.io.File basedir)
          Get info about the current logged in user for the current workspace.
 boolean login(java.lang.String user, java.lang.String password)
          Logins in as the given user, retains authtoken for use with subsequent commands.
 boolean logout()
           
 boolean mkdepot(java.lang.String depotName)
           
 boolean mksnap(java.lang.String snapShotName, java.lang.String basisStream)
           
 boolean mkstream(java.lang.String backingStream, java.lang.String newStreamName)
           
 boolean mkws(java.lang.String basisStream, java.lang.String workspaceName, java.io.File basedir)
          Make workspace
 java.util.List<java.io.File> pop(java.io.File basedir, java.util.Collection<java.io.File> elements)
          Re populate missing files to existing workspace.
 java.util.List<java.io.File> pop(java.io.File basedir, java.lang.String versionSpec, java.util.Collection<java.io.File> elements)
          Populate external to a workspace a specific version, to a specific location.
 java.util.List<java.io.File> promote(java.io.File basedir, java.util.List<java.io.File> files, java.lang.String message)
           
 java.util.List<java.io.File> promoteAll(java.io.File baseDir, java.lang.String commitMessage)
          Any elements that have been kept previously or are currently modified will be promoted.
 boolean promoteStream(java.lang.String subStream, java.lang.String commitMessage, java.util.List<java.io.File> promotedFiles)
           
 boolean reactivate(java.lang.String workSpaceName)
          Reactivate a workspace
 void reset()
          Reset command process, clear command output accumulators
 boolean rmws(java.lang.String workSpaceName)
          Deactivate a workspace
 void setExecutable(java.lang.String accuRevExe)
           
 void setLogger(ScmLogger logger)
           
 void setServer(java.lang.String host, int port)
           
 java.util.Map<java.lang.String,WorkSpace> showRefTrees()
           
 Stream showStream(java.lang.String stream)
           
 java.util.Map<java.lang.String,WorkSpace> showWorkSpaces()
           
 java.lang.String stat(java.io.File element)
          Accurev status of an element
 java.util.List<java.io.File> stat(java.io.File basedir, java.util.Collection<java.io.File> elements, AccuRevStat statType)
           
 CategorisedElements statBackingStream(java.io.File basedir, java.util.Collection<java.io.File> elements)
          Sorts list of elements by whether they exist in the backing stream or not.
 java.util.List<java.io.File> statTag(java.lang.String streamName)
           
 java.util.List<java.io.File> update(java.io.File baseDir, java.lang.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(java.lang.String host,
                          int port)
Method Detail

setServer

public void setServer(java.lang.String host,
                      int port)

setExecutable

public void setExecutable(java.lang.String accuRevExe)

executeCommandLine

protected int executeCommandLine(org.codehaus.plexus.util.cli.Commandline cl,
                                 java.io.InputStream stdin,
                                 CommandOutputConsumer stdout,
                                 org.codehaus.plexus.util.cli.StreamConsumer stderr)
                          throws org.codehaus.plexus.util.cli.CommandLineException
Extracted so test class can override

Parameters:
stdin -
stdout -
stderr -
Returns:
Throws:
org.codehaus.plexus.util.cli.CommandLineException

getCommandline

protected org.codehaus.plexus.util.cli.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(java.lang.String basisStream,
                    java.lang.String workspaceName,
                    java.io.File basedir)
             throws AccuRevException
Make workspace

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

update

public java.util.List<java.io.File> update(java.io.File baseDir,
                                           java.lang.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 java.util.List<java.io.File> add(java.io.File basedir,
                                        java.util.List<java.io.File> elements,
                                        java.lang.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 java.util.List<java.io.File> defunct(java.io.File basedir,
                                            java.util.List<java.io.File> files,
                                            java.lang.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 java.util.List<java.io.File> promote(java.io.File basedir,
                                            java.util.List<java.io.File> files,
                                            java.lang.String message)
                                     throws AccuRevException
Specified by:
promote in interface AccuRev
Throws:
AccuRevException

getCommandLines

public java.lang.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 java.lang.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(java.lang.String depotName)
                throws AccuRevException
Throws:
AccuRevException

mkstream

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

promoteStream

public boolean promoteStream(java.lang.String subStream,
                             java.lang.String commitMessage,
                             java.util.List<java.io.File> promotedFiles)
                      throws AccuRevException
Throws:
AccuRevException

promoteAll

public java.util.List<java.io.File> promoteAll(java.io.File baseDir,
                                               java.lang.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(java.io.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(java.lang.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(java.lang.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 java.lang.String stat(java.io.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(java.io.File basedir,
                    java.lang.String workSpaceName,
                    java.lang.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(java.lang.String snapShotName,
                      java.lang.String basisStream)
               throws AccuRevException
Specified by:
mksnap in interface AccuRev
Throws:
AccuRevException

statTag

public java.util.List<java.io.File> statTag(java.lang.String streamName)
                                     throws AccuRevException
Specified by:
statTag in interface AccuRev
Throws:
AccuRevException

stat

public java.util.List<java.io.File> stat(java.io.File basedir,
                                         java.util.Collection<java.io.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 java.util.List<java.io.File> pop(java.io.File basedir,
                                        java.util.Collection<java.io.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

pop

public java.util.List<java.io.File> pop(java.io.File basedir,
                                        java.lang.String versionSpec,
                                        java.util.Collection<java.io.File> elements)
                                 throws AccuRevException
Description copied from interface: AccuRev
Populate external to a workspace a specific version, to a specific location.

Specified by:
pop in interface AccuRev
elements - (must be depot relative. if null "/./" root is used)
Returns:
Throws:
AccuRevException

statBackingStream

public CategorisedElements statBackingStream(java.io.File basedir,
                                             java.util.Collection<java.io.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 java.util.List<Transaction> history(java.lang.String baseStream,
                                           java.lang.String fromTimeSpec,
                                           java.lang.String toTimeSpec,
                                           int count,
                                           boolean depotHistory,
                                           boolean transactionsOnly)
                                    throws AccuRevException
Specified by:
history in interface AccuRev
Throws:
AccuRevException

diff

public java.util.List<FileDifference> diff(java.lang.String baseStream,
                                           java.lang.String fromTimeSpec,
                                           java.lang.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(java.lang.String user,
                     java.lang.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 java.util.List<BlameLine> annotate(java.io.File basedir,
                                          java.io.File file)
                                   throws AccuRevException
Description copied from interface: AccuRev
AccuRev annotate an element

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

showRefTrees

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

showWorkSpaces

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

showStream

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

getExecutable

public java.lang.String getExecutable()
Specified by:
getExecutable in interface AccuRev

getClientVersion

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


Copyright © 2003-2010 Apache Software Foundation. All Rights Reserved.