|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.ResolveTask
public class ResolveTask
Merge open files with other revisions or files. Automatically resolve the results of a previous Perforce file integration. Note also that having safeMerge, acceptTheirs, acceptYours, and forceResolve all set to false in the associated ResolveFilesAutoOptions object results in "-am" behavior.
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 boolean |
acceptTheirs
If true, automatically accept "their" changes, as documented for the p4 "-at" option. |
protected boolean |
acceptYours
If true, automatically accept "your" changes, as documented for the p4 "-ay" option. |
protected boolean |
forceResolve
Forces auto-mode resolve to accept the merged file even if there are conflicts. |
protected boolean |
safeMerge
If true, only do "safe" resolves, as documented for the p4 "-as" option. |
protected boolean |
showActionsOnly
If true, don't do the actual resolve, just return the actions that would have been performed for the resolve. |
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 | |
---|---|
ResolveTask()
Default constructor. |
Method Summary | |
---|---|
protected void |
execP4Command()
Execute the Perforce resolve command with file specs and options. |
void |
setAcceptTheirs(boolean acceptTheirs)
Sets the accept theirs. |
void |
setAcceptYours(boolean acceptYours)
Sets the accept yours. |
void |
setForceResolve(boolean forceResolve)
Sets the force resolve. |
void |
setSafeMerge(boolean safeMerge)
Sets the safe merge. |
void |
setShowActionsOnly(boolean showActionsOnly)
Sets the show actions only. |
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 boolean safeMerge
protected boolean acceptTheirs
protected boolean acceptYours
protected boolean showActionsOnly
protected boolean forceResolve
Constructor Detail |
---|
public ResolveTask()
Method Detail |
---|
public void setSafeMerge(boolean safeMerge)
safeMerge
- the new safe mergepublic void setAcceptTheirs(boolean acceptTheirs)
acceptTheirs
- the new accept theirspublic void setAcceptYours(boolean acceptYours)
acceptYours
- the new accept yourspublic void setShowActionsOnly(boolean showActionsOnly)
showActionsOnly
- the new show actions onlypublic void setForceResolve(boolean forceResolve)
forceResolve
- the new force resolveprotected void execP4Command() throws org.apache.tools.ant.BuildException
Automatically resolve the results of a previousPerforce file integration.
Note that this is currently a very limited version of the full Perforce resolve feature, corresponding only to (some of) the various auto-resolve features, meaning this method will never invoke (or need to invoke) end user interaction. More extensive versions of the resolve command will be surfaced as needed.
This method notionally returns an IFileSpec, as it's closely related to the integ method and shares many of its return values, but there are several limitations in the use of the returned IFileSpecs. In general, what is returned from this method is a mixture of resolution info messages (i.e. messages from the server that spell out what would or did happen during the resolve), and "true" filespecs. In the latter case, the filespec has a very limited set of valid fields: only client path, from file, and the from revisions are guaranteed to be valid. In the former case, since the info messages do NOT correspond one-to-one with the input file specs that caused the messages, consumers need to explicitly search each returned info message string for the relevant file path or name. This is an unfortunate artefact of the Perforce server's implementation of this command.
Note: results and behaviour are undefined if clashing or inconsistent options are used with this method. In general, the behaviour of (e.g.) setting both acceptYours and acceptTheirs true will be whatever the Perforce server makes of it (usually an error), but that's not guaranteed....
Note also that having safeMerge, acceptTheirs, acceptYours, and forceResolve all set to false in the associated ResolveFilesAutoOptions object results in "-am" behavior.
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 |