Class AccuRevCommandLine
java.lang.Object
org.apache.maven.scm.provider.accurev.cli.AccuRevCommandLine
- All Implemented Interfaces:
AccuRev
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]
private org.codehaus.plexus.util.cli.Commandline
private String
private StringBuilder
private static final File
private static final String[]
private StringBuilder
private String
private long
private String[]
private ScmLogger
private org.codehaus.plexus.util.cli.StreamConsumer
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 -
Method Summary
Modifier and TypeMethodDescriptionAdd the file to the repository.AccuRev annotate an elementboolean
Relocate/reparent a workspaceRemove the file from the repository.AccuRev differences of a stream between to timespecsprivate boolean
executeCommandLine
(File basedir, String[] args, Iterable<File> elements, Pattern matchPattern, List<File> matchedFiles) private boolean
executeCommandLine
(File basedir, String[] args, Iterable<File> elements, org.codehaus.plexus.util.cli.StreamConsumer stdoutConsumer) private int
executeCommandLine
(InputStream stdin, org.codehaus.plexus.util.cli.StreamConsumer stdout) private boolean
executeCommandLine
(String[] args) private int
executeCommandLine
(String[] args, InputStream stdin, org.codehaus.plexus.util.cli.StreamConsumer stdout) protected int
executeCommandLine
(org.codehaus.plexus.util.cli.Commandline cl, InputStream stdin, CommandOutputConsumer stdout, org.codehaus.plexus.util.cli.StreamConsumer stderr) Extracted so test class can overrideprotected org.codehaus.plexus.util.cli.Commandline
The accurev command line strings since last reset(), separated by ";"Full output of accurev command line invocations since resethistory
(String baseStream, String fromTimeSpec, String toTimeSpec, int count, boolean depotHistory, boolean transactionsOnly) Get info about the current logged in user for the current workspace.boolean
Logins in as the given user, retains authtoken for use with subsequent commands.boolean
logout()
boolean
boolean
boolean
boolean
Make workspacepop
(File basedir, Collection<File> elements) Re populate missing files to existing workspace.popExternal
(File basedir, String versionSpec, String tranSpec, Collection<File> elements) Populate external to a workspace a (stream) and transactionId/time, to a specific location.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 workspacevoid
reset()
Reset command process, clear command output accumulatorsboolean
Deactivate a workspaceprivate void
setCommandLineArgs
(String[] args) void
setExecutable
(String accuRevExe) void
void
private void
setWorkingDirectory
(File basedir) showStream
(String stream) Accurev status of an elementstat
(File basedir, Collection<File> elements, AccuRevStat statType) statBackingStream
(File basedir, Collection<File> elements) Sorts list of elements by whether they exist in the backing stream or not.boolean
Update a workspace or reftree, to a particular transaction id
-
Field Details
-
EMPTY_STRING_ARRAY
-
CURRENT_DIR
-
logger
-
cl
private org.codehaus.plexus.util.cli.Commandline cl -
commandLines
-
errorOutput
-
systemErr
private org.codehaus.plexus.util.cli.StreamConsumer systemErr -
hostArgs
-
authArgs
-
executable
-
executableModTime
private long executableModTime -
clientVersion
-
-
Constructor Details
-
AccuRevCommandLine
public AccuRevCommandLine() -
AccuRevCommandLine
-
-
Method Details
-
setServer
-
setExecutable
-
executeCommandLine
private boolean executeCommandLine(File basedir, String[] args, Iterable<File> elements, Pattern matchPattern, List<File> matchedFiles) throws AccuRevException - Throws:
AccuRevException
-
executeCommandLine
private boolean executeCommandLine(File basedir, String[] args, Iterable<File> elements, org.codehaus.plexus.util.cli.StreamConsumer stdoutConsumer) throws AccuRevException - Throws:
AccuRevException
-
setCommandLineArgs
-
executeCommandLine
- Throws:
AccuRevException
-
executeCommandLine
private int executeCommandLine(String[] args, InputStream stdin, org.codehaus.plexus.util.cli.StreamConsumer stdout) throws AccuRevException - Throws:
AccuRevException
-
executeCommandLine
private int executeCommandLine(InputStream stdin, org.codehaus.plexus.util.cli.StreamConsumer stdout) throws AccuRevException - Throws:
AccuRevException
-
executeCommandLine
protected int executeCommandLine(org.codehaus.plexus.util.cli.Commandline cl, 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
Make workspace- Specified by:
mkws
in interfaceAccuRev
- Returns:
- Throws:
AccuRevException
-
update
Update a workspace or reftree, to a particular transaction id- Specified by:
update
in interfaceAccuRev
- Returns:
- Throws:
AccuRevException
-
add
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
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
- Specified by:
promote
in interfaceAccuRev
- Throws:
AccuRevException
-
getCommandLines
Description copied from interface:AccuRev
The accurev command line strings since last reset(), separated by ";"- Specified by:
getCommandLines
in interfaceAccuRev
- Returns:
-
getErrorOutput
Description copied from interface:AccuRev
Full output of accurev command line invocations since reset- Specified by:
getErrorOutput
in interfaceAccuRev
- Returns:
-
setLogger
-
getLogger
-
mkdepot
- Throws:
AccuRevException
-
mkstream
- Throws:
AccuRevException
-
promoteStream
public boolean promoteStream(String subStream, String commitMessage, List<File> promotedFiles) throws AccuRevException - Throws:
AccuRevException
-
promoteAll
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
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
-
setWorkingDirectory
-
reactivate
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
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
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(File basedir, String workSpaceName, 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
- Specified by:
mksnap
in interfaceAccuRev
- Throws:
AccuRevException
-
statTag
- Specified by:
statTag
in interfaceAccuRev
- Throws:
AccuRevException
-
stat
public List<File> stat(File basedir, Collection<File> elements, AccuRevStat statType) throws AccuRevException - Specified by:
stat
in interfaceAccuRev
elements
- list of elements to stat, relative to basedir- Returns:
- Throws:
AccuRevException
-
pop
Description copied from interface:AccuRev
Re populate missing files to existing workspace.- Specified by:
pop
in interfaceAccuRev
- 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 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(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 interfaceAccuRev
- 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 interfaceAccuRev
- 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 interfaceAccuRev
- Returns:
- Throws:
AccuRevException
-
login
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
- Throws:
AccuRevException
-
annotate
Description copied from interface:AccuRev
AccuRev annotate an element- Specified by:
annotate
in interfaceAccuRev
- Returns:
- Throws:
AccuRevException
-
showRefTrees
- Specified by:
showRefTrees
in interfaceAccuRev
- Throws:
AccuRevException
-
showWorkSpaces
- Specified by:
showWorkSpaces
in interfaceAccuRev
- Throws:
AccuRevException
-
showStream
- Specified by:
showStream
in interfaceAccuRev
- Throws:
AccuRevException
-
getExecutable
- Specified by:
getExecutable
in interfaceAccuRev
-
getClientVersion
- Specified by:
getClientVersion
in interfaceAccuRev
- Throws:
AccuRevException
-
syncReplica
- Specified by:
syncReplica
in interfaceAccuRev
- Throws:
AccuRevException
-