com.perforce.p4java.ant.tasks
Class FixTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.perforce.p4java.ant.tasks.PerforceTask
              extended by com.perforce.p4java.ant.tasks.ServerTask
                  extended by com.perforce.p4java.ant.tasks.ClientTask
                      extended by com.perforce.p4java.ant.tasks.FixTask
All Implemented Interfaces:
java.lang.Cloneable

public class FixTask
extends ClientTask

Mark jobs as being fixed by a changelist number. It marks each named job as being fixed by the changelist number given with -c. The changelist may be either pending or, submitted and the jobs may still be opened or already closed (fixed by another changelist).

If the changelist has already been submitted and the job is still open then 'p4 fix' marks the job closed. If the changelist has not been submitted and the job is still open, the job will be marked closed when the changelist is submitted. If the job is already closed, it is left alone.

See Also:
PerforceTask, ServerTask

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
          Changelist number to be used for marking each named job as being fixed (given with -c).
protected  boolean delete
          If true, delete the specified fixes.
protected  java.lang.String jobs
          List of job IDs, separated by whitespace, for jobs that will have their status marked as "fixed" or specified job status.
protected  java.util.List<IFix> retFixList
          Collection of file fixes returned from the Perforce command.
protected  java.lang.String status
          If not null, use this as the new status rather than "fixed".
 
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
FixTask()
          Default constructor.
 
Method Summary
protected  void execP4Command()
          Execute the Perforce fix command with jobs, changelist and options.
protected  java.util.LinkedList<java.lang.String> getJobs()
          Split up the jobs (by whitespace) into tokens.
 java.util.List<IFix> getRetFixList()
          Gets the ret fix list.
 void setChangelist(java.lang.String changelist)
          Sets the changelist.
 void setDelete(boolean delete)
          Sets the delete.
 void setJobs(java.lang.String jobs)
          Sets the jobs.
 void setStatus(java.lang.String status)
          Sets the status.
 
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

changelist

protected java.lang.String changelist
Changelist number to be used for marking each named job as being fixed (given with -c). Initialize to default changelist.


jobs

protected java.lang.String jobs
List of job IDs, separated by whitespace, for jobs that will have their status marked as "fixed" or specified job status.


status

protected java.lang.String status
If not null, use this as the new status rather than "fixed". Corresponds to the -s flag.


delete

protected boolean delete
If true, delete the specified fixes. Corresponds to the -d flag.


retFixList

protected java.util.List<IFix> retFixList
Collection of file fixes returned from the Perforce command.

Constructor Detail

FixTask

public FixTask()
Default constructor.

Method Detail

setChangelist

public void setChangelist(java.lang.String changelist)
Sets the changelist.

Parameters:
changelist - the new changelist

setJobs

public void setJobs(java.lang.String jobs)
Sets the jobs.

Parameters:
jobs - the new jobs

setStatus

public void setStatus(java.lang.String status)
Sets the status.

Parameters:
status - the new status

setDelete

public void setDelete(boolean delete)
Sets the delete.

Parameters:
delete - the new delete

getRetFixList

public java.util.List<IFix> getRetFixList()
Gets the ret fix list.

Returns:
the ret fix list

execP4Command

protected void execP4Command()
                      throws org.apache.tools.ant.BuildException
Execute the Perforce fix command with jobs, changelist and options. Log the returned fixes.

Mark each named job as being fixed by the changelist number given with changelist.

Specified by:
execP4Command in class PerforceTask
Throws:
org.apache.tools.ant.BuildException - the build exception
See Also:
PerforceTask.execP4Command()

getJobs

protected java.util.LinkedList<java.lang.String> getJobs()
Split up the jobs (by whitespace) into tokens.

Returns:
the jobs


Copyright (c) 2010 Perforce Software. All rights reserved.