com.perforce.p4java.ant.tasks
Class LabelsyncTask

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

public class LabelsyncTask
extends ClientTask

Synchronize label with the current client contents. Labelsync causes the named label to reflect the current contents of the client. It records the last revision of each file taken onto the client. The label's name can subsequently be used in a revision specification as @label to refer to the revision of a file as stored in the label.

Without a file argument, labelsync causes the label to reflect the contents of the whole client, by adding, deleting, and updating the label. If a file is given, labelsync updates only that named file.

If the file argument includes a revision specification, then that revision is used instead of the revision taken by the client. If the revision specified is a deleted revision, then the label will include that deleted revision. See 'p4 help revisions' for help specifying revisions.

If the file argument includes a revision range specification, then only files selected by the revision range are updated, and the highest revision in the range is used.

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  boolean addFiles
          If true, add the files in fileSpecs to the label.
protected  boolean deleteFiles
          If true, delete the files in fileSpecs from the label.
protected  java.lang.String name
          The name of label.
protected  boolean noUpdate
          If true, don't actually do the update.
 
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
LabelsyncTask()
          Default constructor.
 
Method Summary
protected  void execP4Command()
          Execute the Perforce labelsync command with file specs, name and options.
 void setAddFiles(boolean addFiles)
          Sets the adds the files.
 void setDeleteFiles(boolean deleteFiles)
          Sets the delete files.
 void setName(java.lang.String name)
          Sets the name.
 void setNoUpdate(boolean noUpdate)
          Sets the no update.
 
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

name

protected java.lang.String name
The name of label.


noUpdate

protected boolean noUpdate
If true, don't actually do the update.


addFiles

protected boolean addFiles
If true, add the files in fileSpecs to the label.


deleteFiles

protected boolean deleteFiles
If true, delete the files in fileSpecs from the label.

Constructor Detail

LabelsyncTask

public LabelsyncTask()
Default constructor.

Method Detail

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - the new name

setNoUpdate

public void setNoUpdate(boolean noUpdate)
Sets the no update.

Parameters:
noUpdate - the new no update

setAddFiles

public void setAddFiles(boolean addFiles)
Sets the adds the files.

Parameters:
addFiles - the new adds the files

setDeleteFiles

public void setDeleteFiles(boolean deleteFiles)
Sets the delete files.

Parameters:
deleteFiles - the new delete files

execP4Command

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

Perform a label sync operation for this client. See the main Perforce documentation for an explanation of the labelsync operation.

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.