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(String host, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 elementbooleanchws(File basedir, String workSpaceName, String newBasisStream)Relocate/reparent a workspaceList<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 timespecsprotected intexecuteCommandLine(org.codehaus.plexus.util.cli.Commandline cl, InputStream stdin, CommandOutputConsumer stdout, org.codehaus.plexus.util.cli.StreamConsumer stderr)Extracted so test class can overrideStringgetClientVersion()protected org.codehaus.plexus.util.cli.CommandlinegetCommandline()StringgetCommandLines()The accurev command line strings since last reset(), separated by ";"StringgetErrorOutput()Full output of accurev command line invocations since resetStringgetExecutable()ScmLoggergetLogger()List<Transaction>history(String baseStream, String fromTimeSpec, String toTimeSpec, int count, boolean depotHistory, boolean transactionsOnly)AccuRevInfoinfo(File basedir)Get info about the current logged in user for the current workspace.booleanlogin(String user, String password)Logins in as the given user, retains authtoken for use with subsequent commands.booleanlogout()booleanmkdepot(String depotName)booleanmksnap(String snapShotName, String basisStream)booleanmkstream(String backingStream, String newStreamName)booleanmkws(String basisStream, String workspaceName, File basedir)Make workspaceList<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.booleanpromoteStream(String subStream, String commitMessage, List<File> promotedFiles)booleanreactivate(String workSpaceName)Reactivate a workspacevoidreset()Reset command process, clear command output accumulatorsbooleanrmws(String workSpaceName)Deactivate a workspacevoidsetExecutable(String accuRevExe)voidsetLogger(ScmLogger logger)voidsetServer(String host, int port)Map<String,WorkSpace>showRefTrees()StreamshowStream(String stream)Map<String,WorkSpace>showWorkSpaces()Stringstat(File element)Accurev status of an elementList<File>stat(File basedir, Collection<File> elements, AccuRevStat statType)CategorisedElementsstatBackingStream(File basedir, Collection<File> elements)Sorts list of elements by whether they exist in the backing stream or not.List<File>statTag(String streamName)booleansyncReplica()List<File>update(File baseDir, String transactionId)Update a workspace or reftree, to a particular transaction id
-
-
-
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(org.codehaus.plexus.util.cli.Commandline cl, InputStream stdin, CommandOutputConsumer stdout, org.codehaus.plexus.util.cli.StreamConsumer stderr) throws org.codehaus.plexus.util.cli.CommandLineExceptionExtracted 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:AccuRevReset command process, clear command output accumulators
-
mkws
public boolean mkws(String basisStream, String workspaceName, File basedir) throws AccuRevException
Make workspace- Specified by:
mkwsin interfaceAccuRev- 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:
updatein interfaceAccuRev- 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:
addin interfaceAccuRev- Parameters:
basedir- base directory of the workspaceelements- 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:AccuRevRemove the file from the repository. Files must be within a workspace- Specified by:
defunctin interfaceAccuRev- Returns:
- Throws:
AccuRevException
-
promote
public List<File> promote(File basedir, List<File> files, String message) throws AccuRevException
- Specified by:
promotein interfaceAccuRev- Throws:
AccuRevException
-
getCommandLines
public String getCommandLines()
Description copied from interface:AccuRevThe accurev command line strings since last reset(), separated by ";"- Specified by:
getCommandLinesin interfaceAccuRev- Returns:
-
getErrorOutput
public String getErrorOutput()
Description copied from interface:AccuRevFull output of accurev command line invocations since reset- Specified by:
getErrorOutputin interfaceAccuRev- 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:
promoteAllin interfaceAccuRev- Parameters:
baseDir- - location of the workspace to act on- Returns:
- Throws:
AccuRevException
-
info
public AccuRevInfo info(File basedir) throws AccuRevException
Description copied from interface:AccuRevGet info about the current logged in user for the current workspace.- Specified by:
infoin interfaceAccuRev- Returns:
- Throws:
AccuRevException
-
reactivate
public boolean reactivate(String workSpaceName) throws AccuRevException
Description copied from interface:AccuRevReactivate a workspace- Specified by:
reactivatein interfaceAccuRev- 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:AccuRevDeactivate a workspace- Specified by:
rmwsin interfaceAccuRev- 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:AccuRevAccurev status of an element- Specified by:
statin 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:AccuRevRelocate/reparent a workspace- Specified by:
chwsin interfaceAccuRevworkSpaceName- (full workspacename including user)- Returns:
- Throws:
AccuRevException
-
mksnap
public boolean mksnap(String snapShotName, String basisStream) throws AccuRevException
- Specified by:
mksnapin interfaceAccuRev- Throws:
AccuRevException
-
statTag
public List<File> statTag(String streamName) throws AccuRevException
- Specified by:
statTagin interfaceAccuRev- Throws:
AccuRevException
-
stat
public List<File> stat(File basedir, Collection<File> elements, AccuRevStat statType) throws AccuRevException
- Specified by:
statin interfaceAccuRevelements- 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:AccuRevRe populate missing files to existing workspace.- Specified by:
popin interfaceAccuRev- Returns:
- Throws:
AccuRevException
-
popExternal
public List<File> popExternal(File basedir, String versionSpec, String tranSpec, Collection<File> elements) throws AccuRevException
Description copied from interface:AccuRevPopulate external to a workspace a (stream) and transactionId/time, to a specific location.You must check
AccuRevCapability.POPULATE_TO_TRANSACTIONbefore passing a tranid/time to this method. If not supported should pass "now","highest" or null for tranSpec- Specified by:
popExternalin interfaceAccuRevversionSpec- 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:AccuRevSorts list of elements by whether they exist in the backing stream or not.- Specified by:
statBackingStreamin 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:
historyin interfaceAccuRev- Throws:
AccuRevException
-
diff
public List<FileDifference> diff(String baseStream, String fromTimeSpec, String toTimeSpec) throws AccuRevException
Description copied from interface:AccuRevAccuRev differences of a stream between to timespecs- Specified by:
diffin interfaceAccuRev- Returns:
- Throws:
AccuRevException
-
login
public boolean login(String user, String password) throws AccuRevException
Description copied from interface:AccuRevLogins in as the given user, retains authtoken for use with subsequent commands.- Specified by:
loginin interfaceAccuRev- 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:AccuRevAccuRev annotate an element- Specified by:
annotatein interfaceAccuRev- Returns:
- Throws:
AccuRevException
-
showRefTrees
public Map<String,WorkSpace> showRefTrees() throws AccuRevException
- Specified by:
showRefTreesin interfaceAccuRev- Throws:
AccuRevException
-
showWorkSpaces
public Map<String,WorkSpace> showWorkSpaces() throws AccuRevException
- Specified by:
showWorkSpacesin interfaceAccuRev- Throws:
AccuRevException
-
showStream
public Stream showStream(String stream) throws AccuRevException
- Specified by:
showStreamin interfaceAccuRev- Throws:
AccuRevException
-
getExecutable
public String getExecutable()
- Specified by:
getExecutablein interfaceAccuRev
-
getClientVersion
public String getClientVersion() throws AccuRevException
- Specified by:
getClientVersionin interfaceAccuRev- Throws:
AccuRevException
-
syncReplica
public boolean syncReplica() throws AccuRevException- Specified by:
syncReplicain interfaceAccuRev- Throws:
AccuRevException
-
-