com.perforce.p4java.ant.tasks
Class ShelveTask

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

public class ShelveTask
extends ClientTask

Store files from a pending changelist in the depot, without submitting them.

'p4 shelve' creates, modifies or deletes shelved files in a pending changelist. Shelved files persist in the depot until they are deleted (using 'p4 shelve -d') or replaced by subsequent shelve commands. After 'p4 shelve', the user can revert the files and restore them later using 'p4 unshelve'. Other users can 'p4 unshelve' the stored files into their own workspaces.

Files that have been shelved can be accessed by the 'p4 diff', 'p4 diff2', 'p4 files' and 'p4 print' commands using the revision specification '@=change', where 'change' is the pending changelist number.

By default, 'p4 shelve' creates a changelist, adds files from the user's default changelist then shelves those files into the depot. The user is presented with a changelist form in the user's text editor that is configured for editing Perforce specifications.

If a file pattern is specified, 'p4 shelve' limits the list of files to those matching the pattern.

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 pending changelist that contains shelved files to be created, deleted, or modified.
protected  boolean deleteFiles
          If true, delete incoming files from the shelve.
protected  boolean forceShelve
          If true, force the shelve operation.
protected  boolean replaceFiles
          If true, allow the incoming files to replace the shelved files.
 
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
ShelveTask()
          Default constructor.
 
Method Summary
protected  void execP4Command()
          Execute the Perforce shelve command with file specs, changelist and options.
 void setChangelist(java.lang.String changelist)
          Sets the changelist.
 void setDeleteFiles(boolean deleteFiles)
          Sets the delete files.
 void setForceShelve(boolean forceShelve)
          Sets the force shelve.
 void setReplaceFiles(boolean replaceFiles)
          Sets the replace files.
 
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
The pending changelist that contains shelved files to be created, deleted, or modified.


forceShelve

protected boolean forceShelve
If true, force the shelve operation.


replaceFiles

protected boolean replaceFiles
If true, allow the incoming files to replace the shelved files.


deleteFiles

protected boolean deleteFiles
If true, delete incoming files from the shelve.

Constructor Detail

ShelveTask

public ShelveTask()
Default constructor.

Method Detail

setChangelist

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

Parameters:
changelist - the new changelist

setForceShelve

public void setForceShelve(boolean forceShelve)
Sets the force shelve.

Parameters:
forceShelve - the new force shelve

setReplaceFiles

public void setReplaceFiles(boolean replaceFiles)
Sets the replace files.

Parameters:
replaceFiles - the new replace 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 shelve command with file specs, changelist and options. Log the returned file specs.

Shelve files in a changelist. Store them on the Perforce server without committing 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.