com.perforce.p4java.ant.tasks
Class ChangeTask

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.ChangeTask
All Implemented Interfaces:
java.lang.Cloneable

public class ChangeTask
extends ClientTask

Create or edit a changelist description. With no argument, 'p4 change' creates a new changelist. If a changelist number is given, 'p4 change' edits an existing, pending changelist. In both cases the changelist specification is placed into a form and the user's editor is invoked. The "deletependingchangelist" (-d flag) option discards a pending changelist, but only if it has no opened files and no pending fixes associated with it.

See Also:
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
          The changelist to be deleted.
protected  boolean deletePendingChangelist
          If true, the pending changelist will be deleted.
protected  java.lang.String description
          The description of the changelist.
protected  java.lang.String property
          The property to be set with the changelist number.
protected  IChangelist retChangelist
          New or updated changelist returned by 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
location, project
 
Constructor Summary
ChangeTask()
          Default constructor.
 
Method Summary
protected  void execP4Command()
          Execute the Perforce change command with the following logical sequence:
 IChangelist getRetChangelist()
          Gets the ret changelist.
 void setChangelist(java.lang.String changelist)
          Sets the changelist.
 void setDeletePendingChangelist(boolean deletePendingChangelist)
          Sets the delete pending changelist.
 void setDescription(java.lang.String description)
          Sets the description.
 void setProperty(java.lang.String property)
          Sets the property.
 
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, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

protected java.lang.String description
The description of the changelist.


deletePendingChangelist

protected boolean deletePendingChangelist
If true, the pending changelist will be deleted.


changelist

protected java.lang.String changelist
The changelist to be deleted.


property

protected java.lang.String property
The property to be set with the changelist number.


retChangelist

protected IChangelist retChangelist
New or updated changelist returned by the Perforce command.

Constructor Detail

ChangeTask

public ChangeTask()
Default constructor.

Method Detail

setDescription

public void setDescription(java.lang.String description)
Sets the description.

Overrides:
setDescription in class org.apache.tools.ant.ProjectComponent
Parameters:
description - the new description

setDeletePendingChangelist

public void setDeletePendingChangelist(boolean deletePendingChangelist)
Sets the delete pending changelist.

Parameters:
deletePendingChangelist - the new delete pending changelist

setChangelist

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

Parameters:
changelist - the new changelist

setProperty

public void setProperty(java.lang.String property)
Sets the property.

Parameters:
property - the new property

getRetChangelist

public IChangelist getRetChangelist()
Gets the ret changelist.

Returns:
the ret changelist

execP4Command

protected void execP4Command()
                      throws org.apache.tools.ant.BuildException
Execute the Perforce change command with the following logical sequence:

1. Delete the changelist, if "deletePendingChangelist" is true.
2. Otherwise, create a new changelist.
3. Assign the new changelist number to a specified property.

Create a new changelist for this Perforce client in the associated Perforce server. The newly-created changelist has no files associated with it (regardless of whether the passed-in changelist spec has files associated with it); if you wish to add files to the new changelist, you need to do a reopen on them explictly after the new changelist is returned.

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


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