com.perforce.p4java.ant.tasks
Class ChangesTask

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

public class ChangesTask
extends ClientTask

Display list of pending and submitted changelists. If files are specified, it limits its report to changelists that affect those files. If the file specification includes a revision range, it limits its report to submitted changelists that affect those particular revisions.

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 clientName
          If non-null, restrict the results to changelists associated with the given client.
protected  boolean includeIntegrated
          If true, also include any changelists integrated into the specified files (if any).
protected  boolean longDesc
          If true, produce a non-truncated long version of the description.
protected  int maxMostRecent
          If positive, restrict the list to the maxMostRecent most recent changelists.
protected  java.lang.String property
          The property to be set with a list of changelist numbers, separated by a whitespace.
protected  java.util.List<IChangelistSummary> retChangelistSummaries
          Collection of changelist summaries returned from the Perforce command.
protected  Type type
          If not null, restrict output to pending, shelved or submitted changelists.
protected  java.lang.String userName
          If non-null, restrict the results to changelists associated with the given user name.
 
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
ChangesTask()
          Default constructor.
 
Method Summary
protected  void execP4Command()
          Execute the Perforce changes command with file specs and options.
 java.util.List<IChangelistSummary> getRetChangelistSummaries()
          Gets the ret changelist summaries.
 void setClientName(java.lang.String clientName)
          Sets the client name.
 void setIncludeIntegrated(boolean includeIntegrated)
          Sets the include integrated.
 void setLongDesc(boolean longDesc)
          Sets the long desc.
 void setMaxMostRecent(int maxMostRecent)
          Sets the max most recent.
 void setProperty(java.lang.String property)
          Sets the property.
 void setType(Type type)
          Sets the type.
 void setUserName(java.lang.String userName)
          Sets the user name.
 
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

maxMostRecent

protected int maxMostRecent
If positive, restrict the list to the maxMostRecent most recent changelists. Corresponds to -mmax.


clientName

protected java.lang.String clientName
If non-null, restrict the results to changelists associated with the given client. Corresponds to -cclient flag.


userName

protected java.lang.String userName
If non-null, restrict the results to changelists associated with the given user name. Corresponds to -uuser flag.


includeIntegrated

protected boolean includeIntegrated
If true, also include any changelists integrated into the specified files (if any). Corresponds to -i flag.


type

protected Type type
If not null, restrict output to pending, shelved or submitted changelists. Corresponds to -sstatus flag.


longDesc

protected boolean longDesc
If true, produce a non-truncated long version of the description. Corresponds to the -l flag.


property

protected java.lang.String property
The property to be set with a list of changelist numbers, separated by a whitespace.


retChangelistSummaries

protected java.util.List<IChangelistSummary> retChangelistSummaries
Collection of changelist summaries returned from the Perforce command.

Constructor Detail

ChangesTask

public ChangesTask()
Default constructor.

Method Detail

setMaxMostRecent

public void setMaxMostRecent(int maxMostRecent)
Sets the max most recent.

Parameters:
maxMostRecent - the new max most recent

setClientName

public void setClientName(java.lang.String clientName)
Sets the client name.

Parameters:
clientName - the new client name

setUserName

public void setUserName(java.lang.String userName)
Sets the user name.

Parameters:
userName - the new user name

setIncludeIntegrated

public void setIncludeIntegrated(boolean includeIntegrated)
Sets the include integrated.

Parameters:
includeIntegrated - the new include integrated

setType

public void setType(Type type)
Sets the type.

Parameters:
type - the new type

setLongDesc

public void setLongDesc(boolean longDesc)
Sets the long desc.

Parameters:
longDesc - the new long desc

setProperty

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

Parameters:
property - the new property

getRetChangelistSummaries

public java.util.List<IChangelistSummary> getRetChangelistSummaries()
Gets the ret changelist summaries.

Returns:
the ret changelist summaries

execP4Command

protected void execP4Command()
                      throws org.apache.tools.ant.BuildException
Execute the Perforce changes command with file specs and options. Log the returned changelist summaries and set the changelist numbers to the specified property.

Get a list of Perforce changelist summary objects from the Perforce server.

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.