com.perforce.p4java.ant.tasks
Class TagTask

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

public class TagTask
extends ClientTask

Tag files with a label.

Tag associates the named label with the file revisions indicated by the file argument. Once file revisions are tagged with a label, revision specifications of the form '@label' can be used to refer to them.

If the file argument does not include a revision specification, the head revisions will be tagged. See 'p4 help revisions' for revision specification options.

If the file argument includes a revision range specification, only the files with revisions in that range will be tagged. Files with more than one revision in the range will be tagged at the highest revision.

The "delete" (-d flag) option deletes the association between the specified files and the label, regardless of revision.

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  boolean delete
          Deletes the association between the specified files and the label, regardless of revision.
protected  java.lang.String label
          Name of the label.
protected  boolean listOnly
          Lists the files that would be tagged, but doesn't actually do anything.
 
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
TagTask()
          Default constructor.
 
Method Summary
protected  void execP4Command()
          Execute the Perforce tag command with file specs, label and options.
 void setDelete(boolean delete)
          Sets the delete.
 void setLabel(java.lang.String label)
          Sets the label.
 void setListOnly(boolean listOnly)
          Sets the list 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

listOnly

protected boolean listOnly
Lists the files that would be tagged, but doesn't actually do anything.


delete

protected boolean delete
Deletes the association between the specified files and the label, regardless of revision.


label

protected java.lang.String label
Name of the label.

Constructor Detail

TagTask

public TagTask()
Default constructor.

Method Detail

setListOnly

public void setListOnly(boolean listOnly)
Sets the list only.

Parameters:
listOnly - the new list only

setDelete

public void setDelete(boolean delete)
Sets the delete.

Parameters:
delete - the new delete

setLabel

public void setLabel(java.lang.String label)
Sets the label.

Parameters:
label - the new label

execP4Command

protected void execP4Command()
                      throws org.apache.tools.ant.BuildException
Execute the Perforce tag command with file specs, label and options. Log the returned file specs.

Tag associates the named label with the file revisions indicated by the file argument. Once file revisions are tagged with a label, revision specifications of the form '@label' can be used to refer to them.

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.