Class AccuRevCommandLine
- java.lang.Object
-
- org.apache.maven.scm.provider.accurev.cli.AccuRevCommandLine
-
-
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
Constructors Constructor Description AccuRevCommandLine()
AccuRevCommandLine(java.lang.String host, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 elementboolean
chws(java.io.File basedir, java.lang.String workSpaceName, java.lang.String newBasisStream)
Relocate/reparent a workspacejava.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 timespecsprotected 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 overridejava.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 resetjava.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 workspacejava.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>
popExternal(java.io.File basedir, java.lang.String versionSpec, java.lang.String tranSpec, java.util.Collection<java.io.File> elements)
Populate external to a workspace a (stream) and transactionId/time, 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 workspacevoid
reset()
Reset command process, clear command output accumulatorsboolean
rmws(java.lang.String workSpaceName)
Deactivate a workspacevoid
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 elementjava.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)
boolean
syncReplica()
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
-
-
-
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
-
mkws
public boolean mkws(java.lang.String basisStream, java.lang.String workspaceName, java.io.File basedir) throws AccuRevException
Make workspace- Specified by:
mkws
in interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- Parameters:
basedir
- base directory of the workspaceelements
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
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 interfaceAccuRev
- Throws:
AccuRevException
-
statTag
public java.util.List<java.io.File> statTag(java.lang.String streamName) throws AccuRevException
- Specified by:
statTag
in interfaceAccuRev
- 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 interfaceAccuRev
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 interfaceAccuRev
- Returns:
- Throws:
AccuRevException
-
popExternal
public java.util.List<java.io.File> popExternal(java.io.File basedir, java.lang.String versionSpec, java.lang.String tranSpec, java.util.Collection<java.io.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 interfaceAccuRev
versionSpec
- stream to update totranSpec
- 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(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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- Returns:
- Throws:
AccuRevException
-
showRefTrees
public java.util.Map<java.lang.String,WorkSpace> showRefTrees() throws AccuRevException
- Specified by:
showRefTrees
in interfaceAccuRev
- Throws:
AccuRevException
-
showWorkSpaces
public java.util.Map<java.lang.String,WorkSpace> showWorkSpaces() throws AccuRevException
- Specified by:
showWorkSpaces
in interfaceAccuRev
- Throws:
AccuRevException
-
showStream
public Stream showStream(java.lang.String stream) throws AccuRevException
- Specified by:
showStream
in interfaceAccuRev
- Throws:
AccuRevException
-
getExecutable
public java.lang.String getExecutable()
- Specified by:
getExecutable
in interfaceAccuRev
-
getClientVersion
public java.lang.String getClientVersion() throws AccuRevException
- Specified by:
getClientVersion
in interfaceAccuRev
- Throws:
AccuRevException
-
syncReplica
public boolean syncReplica() throws AccuRevException
- Specified by:
syncReplica
in interfaceAccuRev
- Throws:
AccuRevException
-
-