|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task com.perforce.p4java.ant.tasks.PerforceTask com.perforce.p4java.ant.tasks.ServerTask com.perforce.p4java.ant.tasks.ClientTask com.perforce.p4java.ant.tasks.MoveTask
public class MoveTask
Move file(s) from one location to another.
Move takes an already opened file and moves it from one client location to another, reopening it as a pending depot move. When the file is submitted with 'p4 submit', its depot file is moved accordingly. Wildcards in fromFile and toFile must match. The fromFile must be a file opened for add or edit. 'p4 opened' lists pending moves. 'p4 diff' can compare a moved client file with its depot original, 'p4 sync' can schedule an update of a moved file, and 'p4 resolve' can resolve the update. A client file may be moved many times before it is submitted. Moving a file back to its original location will undo a pending move, leaving unsubmitted content intact. Using 'p4 revert' will both undo the move and revert the unsubmitted content.
PerforceTask
,
ClientTask
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.perforce.p4java.ant.tasks.ServerTask |
---|
ServerTask.GlobalOption |
Nested classes/interfaces inherited from class com.perforce.p4java.ant.tasks.PerforceTask |
---|
PerforceTask.Field, PerforceTask.File |
Field Summary | |
---|---|
protected java.lang.String |
changelist
If not IChangelist.UNKNOWN, the files are opened in the numbered pending changelist instead of the 'default' changelist. |
protected java.lang.String |
fileType
If not null, the file is reopened as that filetype. |
protected boolean |
force
If true, force a move to an existing target file; the file must be synced and not opened. |
protected java.lang.String |
fromFile
Source file and revision specifiers, separated by space. |
protected IFileSpec |
fromFileSpec
Source file and revision specifier for the Perforce command. |
protected boolean |
listOnly
If true, don't actually perform the move, just return what would happen if the move was performed. |
protected boolean |
noClientMove
If true, bypasses the client file rename. |
protected java.lang.String |
toFile
Target file and revision specifiers, separated by space. |
protected IFileSpec |
toFileSpec
Target file and revision specifier for the Perforce command. |
Fields inherited from class com.perforce.p4java.ant.tasks.ClientTask |
---|
p4Client |
Fields inherited from class com.perforce.p4java.ant.tasks.ServerTask |
---|
allHosts, commandOptions, globaloptions, hostName, P4_SERVER_PROTOCOL_PROPERTIES_FILE, P4_SERVER_USAGE_PROPERTIES_FILE, p4Server, programName, programVersion, protocolPropertiesFile, protocolProps, textLanguage, unsetClientName, unsetUserName, usagePropertiesFile, usageProps, workingDirectory |
Fields inherited from class com.perforce.p4java.ant.tasks.PerforceTask |
---|
charset, client, failOnError, fields, FILE_TOKEN_REGEX_PATTERN, fileList, files, fileSpecs, LINE_PADDING, LINE_SEPARATOR, p4Messages, passwd, port, protocol, retFileSpecs, retStatusMessage, user |
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
MoveTask()
Default constructor. |
Method Summary | |
---|---|
protected void |
execP4Command()
Execute the Perforce move command with source and target file specs and options. |
IFileSpec |
getFromFileSpec()
Gets the from file spec. |
IFileSpec |
getToFileSpec()
Gets the to file spec. |
void |
setChangelist(java.lang.String changelist)
Sets the changelist. |
void |
setFileType(java.lang.String fileType)
Sets the file type. |
void |
setForce(boolean force)
Sets the force. |
void |
setFromFile(java.lang.String fromFile)
Sets the from file. |
void |
setListOnly(boolean listOnly)
Sets the list only. |
void |
setNoClientMove(boolean noClientMove)
Sets the no client move. |
void |
setToFile(java.lang.String toFile)
Sets the to file. |
Methods inherited from class com.perforce.p4java.ant.tasks.ClientTask |
---|
cleanupP4, getP4Client, initP4, setP4Client |
Methods inherited from class com.perforce.p4java.ant.tasks.ServerTask |
---|
cleanupP4Server, createGlobalOption, getGlobalOptions, getP4Server, initP4Server, initP4ServerOptions, setAllHosts, setHostName, setP4Server, setProgramName, setProgramVersion, setProtocolPropertiesFile, setProtocolProps, setTextLanguage, setUnsetClientName, setUnsetUserName, setUsagePropertiesFile, setUsageProps, setWorkingDirectory |
Methods inherited from class com.perforce.p4java.ant.tasks.PerforceTask |
---|
addFileset, createField, createFile, execute, getFields, getFiles, getFileSpecs, getRetFileSpecs, getRetStatusMessage, init, isEmpty, logChangelistSummaries, logChangelistSummary, logExtendedFileSpec, logExtendedFileSpecs, logFileDiff, logFileDiffs, logFileLineMatch, logFileLineMatches, logFileSpec, logFileSpecs, logFix, logFixes, logJob, logJobs, parseChangelist, setCharset, setClient, setFailOnError, setFiles, setPasswd, setPort, setProtocol, setUser |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String fromFile
protected java.lang.String toFile
protected java.lang.String changelist
protected boolean listOnly
protected boolean force
protected boolean noClientMove
protected java.lang.String fileType
protected IFileSpec fromFileSpec
protected IFileSpec toFileSpec
Constructor Detail |
---|
public MoveTask()
Method Detail |
---|
public void setFromFile(java.lang.String fromFile)
fromFile
- the new from filepublic void setToFile(java.lang.String toFile)
toFile
- the new to filepublic void setChangelist(java.lang.String changelist)
changelist
- the new changelistpublic void setListOnly(boolean listOnly)
listOnly
- the new list onlypublic void setForce(boolean force)
force
- the new forcepublic void setNoClientMove(boolean noClientMove)
noClientMove
- the new no client movepublic void setFileType(java.lang.String fileType)
fileType
- the new file typepublic IFileSpec getFromFileSpec()
public IFileSpec getToFileSpec()
protected void execP4Command() throws org.apache.tools.ant.BuildException
Move a file already opened for edit or add (the fromFile) to the destination file (the toFile). A file can be moved many times before it is submitted; moving it back to its original location will reopen it for edit. The full semantics of this operation (which can be confusing) are found in the main 'p4 help' documentation.
Note that this operation is not supported on servers earlier than 2009.1; any attempt to use this on earlier servers will result in a RequestException with a suitable message.
execP4Command
in class PerforceTask
org.apache.tools.ant.BuildException
- the build exceptionPerforceTask.execP4Command()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |