com.perforce.p4java.ant.tasks
Class UnshelveTask

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

public class UnshelveTask
extends ClientTask

Restore shelved files from a pending change into a workspace.

'p4 unshelve' retrieves the shelved files from a pending changelist and copies them into a pending changelist on the invoking user's workspace. Unshelving files from a pending changelist is restricted by the user's permissions on the files. A successful unshelve operation places the shelved files on the user's workspace with the same open action and pending integration history as if it had originated from that user and client.

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 forceUnshelve
          Force the unshelve operation.
protected  java.lang.String fromChangelist
          The source pending changelist that contains the shelved files.
protected  boolean preview
          previews what would be unshelved without actually changing any files or metadata.
protected  java.lang.String toChangelist
          The target changelist to receive 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
UnshelveTask()
          Default constructor.
 
Method Summary
protected  void execP4Command()
          Execute the Perforce unshelve command with source changelist, target changelist and options.
 void setForceUnshelve(boolean forceUnshelve)
          Sets the force unshelve.
 void setFromChangelist(java.lang.String fromChangelist)
          Sets the from changelist.
 void setPreview(boolean preview)
          Sets the preview.
 void setToChangelist(java.lang.String toChangelist)
          Sets the to changelist.
 
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

fromChangelist

protected java.lang.String fromChangelist
The source pending changelist that contains the shelved files.


toChangelist

protected java.lang.String toChangelist
The target changelist to receive the shelved files.


forceUnshelve

protected boolean forceUnshelve
Force the unshelve operation.


preview

protected boolean preview
previews what would be unshelved without actually changing any files or metadata.

Constructor Detail

UnshelveTask

public UnshelveTask()
Default constructor.

Method Detail

setFromChangelist

public void setFromChangelist(java.lang.String fromChangelist)
Sets the from changelist.

Parameters:
fromChangelist - the new from changelist

setToChangelist

public void setToChangelist(java.lang.String toChangelist)
Sets the to changelist.

Parameters:
toChangelist - the new to changelist

setForceUnshelve

public void setForceUnshelve(boolean forceUnshelve)
Sets the force unshelve.

Parameters:
forceUnshelve - the new force unshelve

setPreview

public void setPreview(boolean preview)
Sets the preview.

Parameters:
preview - the new preview

execP4Command

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

Restore shelved files from a pending change into a workspace.

Unshelving files from a pending changelist is restricted by the user's permissions on the files. A successful unshelve operation places the shelved files on the user's workspace with the same open action and pending integration history as if it had originated from that user and client.

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.