|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perforce.p4java.impl.generic.core.ServerResource
com.perforce.p4java.impl.mapbased.client.ClientSummary
com.perforce.p4java.impl.mapbased.client.Client
public class Client
Default implementation of the generic parts of an IClient interface.
Note that this version is very much tied to the map-based server implementation, and can (generally) only be used with that server type. This is not an onerous requirement, however, as all IServer objects returned from the ServerFactory are map-based implementations.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.perforce.p4java.client.IClientSummary |
---|
IClientSummary.ClientLineEnd, IClientSummary.IClientOptions, IClientSummary.IClientSubmitOptions |
Field Summary | |
---|---|
static java.lang.String |
MERGE_TMP_FILENAME_KEY
|
Fields inherited from class com.perforce.p4java.impl.mapbased.client.ClientSummary |
---|
accessed, alternateRoots, description, hostName, lineEnd, name, options, ownerName, root, submitOptions, updated |
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource |
---|
refreshable, server, updateable |
Constructor Summary | |
---|---|
Client()
Default constructor. |
|
Client(IClientSummary clientSummary,
boolean refresh)
Construct a new Client object using the passed-in client summary object as a partial template. |
|
Client(IClientSummary clientSummary,
IServer serverImpl,
boolean refresh)
Construct a new Client object using the passed-in client summary object as a partial template along with the passed-in IServer object. |
|
Client(IServer server)
Note that any IServer object returned by the ServerFactory will work for the serverImpl parameter; if not, a suitable cast exception will be thrown. |
|
Client(IServer serverImpl,
java.util.Map<java.lang.String,java.lang.Object> map)
Construct a suitable Client object from an IServer and a map returned from the Perforce server. |
|
Client(java.lang.String name,
java.util.Date accessed,
java.util.Date updated,
java.lang.String description,
java.lang.String hostName,
java.lang.String ownerName,
java.lang.String root,
IClientSummary.ClientLineEnd lineEnd,
IClientSummary.IClientOptions options,
IClientSummary.IClientSubmitOptions submitOptions,
java.util.List<java.lang.String> alternateRoots,
IServer serverImpl,
ClientView clientView)
Construct a new Client object from explicit fields. |
Method Summary | |
---|---|
java.util.List<IFileSpec> |
addFiles(java.util.List<IFileSpec> fileSpecs,
boolean noUpdate,
int changeListId,
java.lang.String fileType,
boolean useWildcards)
Open one or more Perforce client workspace files for adding to the Perforce server. |
void |
complete()
Completing a client calls refresh() and updates the
#isComplete() flag. |
IChangelist |
createChangelist(IChangelist newChangelist)
Create a new changelist for this Perforce client in the associated Perforce server. |
java.util.List<IFileSpec> |
deleteFiles(java.util.List<IFileSpec> fileSpecs,
int changeListId,
boolean noUpdate)
Open a Perforce client workspace file for deletion from a Perforce depot. |
java.util.List<IFileSpec> |
editFiles(java.util.List<IFileSpec> fileSpecs,
boolean noUpdate,
boolean bypassClientUpdate,
int changeListId,
java.lang.String fileType)
Open one or more Perforce client workspace files for editing. |
ClientView |
getClientView()
Get the Perforce client view associated with this client, if any. |
java.util.List<IFileSpec> |
getDiffFiles(java.util.List<IFileSpec> fileSpecs,
int maxFiles,
boolean diffNonTextFiles,
boolean openedDifferentMissing,
boolean openedForIntegrate,
boolean unopenedMissing,
boolean unopenedDifferent,
boolean unopenedWithStatus,
boolean openedSame)
Return a list of files that differ in some (arbitrarily complex) way from depot. |
IServer |
getServer()
Return the IServer object representing the Perforce server associated with this Perforce client. |
java.util.List<IFileSpec> |
haveList(java.util.List<IFileSpec> fileSpecs)
Return a list of all Perforce-managed files and versions that the Perforce server believes this Perforce client workspace has as of the latest sync. |
java.util.List<IFileSpec> |
integrateFiles(int changeListId,
boolean showActionsOnly,
IntegrationOptions integOpts,
java.lang.String branchSpec,
IFileSpec fromFile,
IFileSpec toFile)
Integrate ("merge") from one Perforce filespec to another. |
java.util.List<IFileSpec> |
labelSync(java.util.List<IFileSpec> fileSpecs,
java.lang.String labelName,
boolean noUpdate,
boolean addFiles,
boolean deleteFiles)
Perform a label sync operation for this client. |
java.util.List<IFileSpec> |
lockFiles(java.util.List<IFileSpec> fileSpecs,
int changeListId)
Lock an opened file against changelist submission. |
java.util.List<IFileSpec> |
openedFiles(java.util.List<IFileSpec> fileSpecs,
int maxFiles,
int changeListId)
If one or more Perforce file specs is passed-in, return the opened / locked status of each file (if known) within an IFileSpec object; otherwise return a list of all files known to be open for this Perforce client workspace. |
void |
refresh()
This method will refresh by getting the complete client model. |
java.util.List<IFileSpec> |
reopenFiles(java.util.List<IFileSpec> fileSpecs,
int changeListId,
java.lang.String fileType)
Reopen Perforce files in a new changelist. |
java.util.List<IFileSpec> |
resolvedFiles(java.util.List<IFileSpec> fileSpecs,
boolean showBaseRevision)
Return a list of files resolved but not submitted for this client. |
IFileSpec |
resolveFile(IFileSpec targetFile,
java.io.InputStream sourceStream)
Resolve a file integration by using the contents of the sourceStream InputStream as the resolve result. |
java.util.List<IFileSpec> |
resolveFilesAuto(java.util.List<IFileSpec> fileSpecs,
boolean safeMerge,
boolean acceptTheirs,
boolean acceptYours,
boolean showActionsOnly,
boolean forceResolve)
Automatically resolve the results of a previousPerforce file integration. |
java.util.List<IFileSpec> |
revertFiles(java.util.List<IFileSpec> fileSpecs,
boolean noUpdate,
int changeListId,
boolean revertOnlyUnchanged,
boolean noRefresh)
Revert an open Perforce client workspace file back to the revision previously synced from the Perforce depot, discarding any pending changelists or integrations that have been made so far. |
void |
setClientView(ClientView clientView)
Set the Perforce client view associated with this client. |
void |
setServer(IServer server)
Note that this will fail with a class cast exception if the passed-in server is not a mapbased ServerImpl object. |
java.util.List<IFileSpec> |
shelveChangelist(IChangelist list)
Shelve the file(s) in a pending changelist. |
java.util.List<IFileSpec> |
shelveChangelist(int changelistId,
java.util.List<IFileSpec> fileSpecs,
boolean forceUpdate,
boolean replace,
boolean discard)
Update/replace/delete shelved file(s) from a pending changelist. |
java.util.List<IFileSpec> |
sync(java.util.List<IFileSpec> fileSpecs,
boolean forceUpdate,
boolean noUpdate,
boolean clientBypass,
boolean serverBypass)
Sync a Perforce client workspace against the Perforce server. |
java.util.List<IFileSpec> |
unlockFiles(java.util.List<IFileSpec> fileSpecs,
int changeListId,
boolean force)
Release locked files but leave them open. |
java.util.List<IFileSpec> |
unshelveChangelist(int shelveChangelistId,
java.util.List<IFileSpec> fileSpecs,
int clientChangelistId,
boolean forceOverwrite,
boolean previewOnly)
Unshelve file(s) from a shelved changelist |
void |
update()
Update the Perforce server object associated with the underlying P4Java object, if possible. |
java.util.List<IFileSpec> |
where(java.util.List<IFileSpec> fileSpecs)
For each of the passed-in file specs, show how the named file maps through the client view. |
Methods inherited from class com.perforce.p4java.impl.mapbased.client.ClientSummary |
---|
getAccessed, getAlternateRoots, getDescription, getHostName, getLineEnd, getName, getOptions, getOwnerName, getRoot, getSubmitOptions, getUpdated, setAccessed, setAlternateRoots, setDescription, setHostName, setLineEnd, setName, setOptions, setOwnerName, setRoot, setSubmitOptions, setUpdated |
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource |
---|
canRefresh, canUpdate, setRefreshable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.perforce.p4java.client.IClientSummary |
---|
getAccessed, getAlternateRoots, getDescription, getHostName, getLineEnd, getName, getOptions, getOwnerName, getRoot, getSubmitOptions, getUpdated, setAccessed, setAlternateRoots, setDescription, setHostName, setLineEnd, setName, setOptions, setOwnerName, setRoot, setSubmitOptions, setUpdated |
Methods inherited from interface com.perforce.p4java.core.IServerResource |
---|
canRefresh, canUpdate |
Field Detail |
---|
public static final java.lang.String MERGE_TMP_FILENAME_KEY
Constructor Detail |
---|
public Client()
ClientSummary fields are set as noted in the ClientSummary default constructor comments.
public Client(IServer server)
ClientSummary fields are set as noted in the ClientSummary default constructor comments.
server
- an IServer server returned from the server factory.public Client(java.lang.String name, java.util.Date accessed, java.util.Date updated, java.lang.String description, java.lang.String hostName, java.lang.String ownerName, java.lang.String root, IClientSummary.ClientLineEnd lineEnd, IClientSummary.IClientOptions options, IClientSummary.IClientSubmitOptions submitOptions, java.util.List<java.lang.String> alternateRoots, IServer serverImpl, ClientView clientView)
Note that any IServer object returned by the ServerFactory will work for the serverImpl parameter; if not, a suitable cast exception will be thrown.
public Client(IServer serverImpl, java.util.Map<java.lang.String,java.lang.Object> map)
Note that any IServer object returned by the ServerFactory will work for the serverImpl parameter; if not, a suitable cast exception will be thrown.
public Client(IClientSummary clientSummary, boolean refresh) throws ConnectionException, RequestException, AccessException
If summary is null, this is equivalent to calling the default constructor. If clientSummary is not null, and refresh is false, the relevant ClientSummary superclass is initialized by copying the passed-in summary fields. If clientSummary is not null and refresh is true, the Client is constructed by calling refresh() using the clientSummary's name; if refresh is false, the client view will be as for the default constructor.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerpublic Client(IClientSummary clientSummary, IServer serverImpl, boolean refresh) throws ConnectionException, RequestException, AccessException
Note that any IServer object returned by the ServerFactory will work for the serverImpl parameter; if not, a suitable cast exception will be thrown.
If summary is null, this is equivalent to calling the default constructor. If clientSummary is not null, and refresh is false, the relevant ClientSummary superclass is initialized by copying the passed-in summary fields. If clientSummary is not null and refresh is true, the Client is constructed by calling refresh() using the clientSummary's name; if refresh is false, the client view will be as for the default constructor.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerMethod Detail |
---|
public IServer getServer()
IClient
getServer
in interface IClient
IClient.getServer()
public void complete() throws ConnectionException, RequestException, AccessException
refresh()
and updates the
#isComplete()
flag. A no op for the new IClient object.
complete
in class ServerResource
ConnectionException
RequestException
AccessException
refresh()
,
ServerResource.complete()
public void refresh() throws ConnectionException, RequestException, AccessException
refresh
in interface IServerResource
refresh
in class ServerResource
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerServerResource.refresh()
public void update() throws ConnectionException, RequestException, AccessException
IServerResource
The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).
update
in interface IServerResource
update
in class ServerResource
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerServerResource.update()
public ClientView getClientView()
IClient
getClientView
in interface IClient
IClient.getClientView()
public void setClientView(ClientView clientView)
IClient
setClientView
in interface IClient
clientView
- new Perforce client view for the client.IClient.setClientView(com.perforce.p4java.impl.generic.client.ClientView)
public void setServer(IServer server)
setServer
in interface IClient
setServer
in interface IServerResource
setServer
in class ServerResource
server
- ServerImpl server object.IServerResource.setServer(com.perforce.p4java.server.IServer)
public java.util.List<IFileSpec> sync(java.util.List<IFileSpec> fileSpecs, boolean forceUpdate, boolean noUpdate, boolean clientBypass, boolean serverBypass) throws ConnectionException, RequestException, AccessException
IClient
sync
in interface IClient
fileSpecs
- files to be synchronized; if empty, synchronize all client files.forceUpdate
- if true, forces resynchronization even if the client already
has the file, and clobbers writable files. This flag doesn't affect
open files. Corresponds to the p4 sync "-f" flag.noUpdate
- causes sync not to update the client workspace, but to
display what normally would be updated. Corresponds to the p4 sync "-n" flag.clientBypass
- bypasses the client file update. It can be used to
make the server believe that a client workspace already has the file.
Corresponds to the p4 sync "-k" flag.serverBypass
- populates the client workspace, but does not update the
server to reflect those updates. Any file that is already synced or
opened will be bypassed with a warning message.
Corresponds to the p4 sync "-p" flag.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIClient.sync(java.util.List, boolean, boolean, boolean, boolean)
public java.util.List<IFileSpec> labelSync(java.util.List<IFileSpec> fileSpecs, java.lang.String labelName, boolean noUpdate, boolean addFiles, boolean deleteFiles) throws ConnectionException, RequestException, AccessException
IClient
labelSync
in interface IClient
fileSpecs
- if non-null,labelName
- non-null name of the label to be sync'dnoUpdate
- if true, just show what would result with the labelsync
rather than actually doing itaddFiles
- if true, add the files in fileSpecs to the labeldeleteFiles
- if true, delete the files in fileSpecs from the label
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIClient.labelSync(java.util.List, java.lang.String, boolean, boolean, boolean)
public IChangelist createChangelist(IChangelist newChangelist) throws ConnectionException, RequestException, AccessException
IClient
The new changelist is returned if the command is successful; this changelist object will include the new changelist ID.
createChangelist
in interface IClient
newChangelist
- non-null specification for the new changelist; if the
newChangelist's ID is not IChangelist.DEFAULT, it is ignored.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIClient.createChangelist(com.perforce.p4java.core.IChangelist)
public java.util.List<IFileSpec> addFiles(java.util.List<IFileSpec> fileSpecs, boolean noUpdate, int changeListId, java.lang.String fileType, boolean useWildcards) throws ConnectionException, AccessException
IClient
addFiles
in interface IClient
fileSpecs
- non-null list of files to be opened, in Perforce client or
depot or local path format.noUpdate
- if true, don't actually do the open, just return the files that
would have been opened for addition.changeListId
- if positive, the opened files are put into the pending
changelist identified by changeListId; this changelist must have been
previously created. If zero or negative, the file is opened in the 'default'
(unnumbered) changelist.fileType
- if non-null, the files are added as that filetype.
See 'p4 help filetypes' to attempt to make any sense of Perforce file types.useWildcards
- if true, filenames that contain wildcards are permitted.
See the main Perforce documentation for file adding for details.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.addFiles(java.util.List, boolean, int, java.lang.String, boolean)
public java.util.List<IFileSpec> deleteFiles(java.util.List<IFileSpec> fileSpecs, int changeListId, boolean noUpdate) throws ConnectionException, AccessException
IClient
deleteFiles
in interface IClient
fileSpecs
- non-null list of files to be openedchangeListId
- if positive, the opened files are put into the pending
changelist identified by changeListId; this changelist must have been
previously created. If zero or negative, the file is opened in the 'default'
(unnumbered) changelist.noUpdate
- if true, don't actually do the open, just return the files that
would have been opened for deletion.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.deleteFiles(java.util.List, int, boolean)
public java.util.List<IFileSpec> editFiles(java.util.List<IFileSpec> fileSpecs, boolean noUpdate, boolean bypassClientUpdate, int changeListId, java.lang.String fileType) throws RequestException, ConnectionException, AccessException
IClient
editFiles
in interface IClient
fileSpecs
- non-null list of files to be opened, in Perforce client or
depot or local path format.noUpdate
- if true, don't actually do the open, just return the files that
would have been opened for edit.bypassClientUpdate
- if true, the edit bypasses any client file update.
Equivalent to the new 2009.2 and later "-k" option. If set true with
a Perforce server earlier than 2009.2, will produce a suitable
RequestException. Note: this option can cause havoc if you don't
use care...changeListId
- if positive, the opened files are put into the pending
changelist identified by changeListId; this changelist must have been
previously created. If zero or negative, the file is opened in the 'default'
(unnumbered) changelist.fileType
- if non-null, the file is opened as that filetype.
Otherwise, the filetype of the previous revision is reused.
If the filetype given is a partial filetype, that partial
filetype is combined with the previous revision's filetype.
See 'p4 help filetypes' to attempt to make any sense of this..
RequestException
- if the Perforce server encounters an error during
its processing of the request
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.editFiles(java.util.List, boolean, boolean, int, java.lang.String)
public java.util.List<IFileSpec> revertFiles(java.util.List<IFileSpec> fileSpecs, boolean noUpdate, int changeListId, boolean revertOnlyUnchanged, boolean noRefresh) throws ConnectionException, AccessException
IClient
revertFiles
in interface IClient
fileSpecs
- non-null (but possibly-empty) list of files to be revertednoUpdate
- if true, don't actually do the revert, just return the files that
would have been revertedchangeListId
- if positive, revert only those files in the pending changelist
given in changeListId.revertOnlyUnchanged
- if true, revert only those files which are opened
for edit or integrate and are unchanged or missing.noRefresh
- if true, bypass the client file refresh of the reverted files.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.revertFiles(java.util.List, boolean, int, boolean, boolean)
public java.util.List<IFileSpec> haveList(java.util.List<IFileSpec> fileSpecs) throws ConnectionException, AccessException
IClient
Only the depotFile, revision, clientPath, and localPath fields of the returned file specs are guaranteed to be valid.
haveList
in interface IClient
fileSpecs
- file specs; if empty or null, return all qualifying files
ConnectionException
- if the Perforce server is unreachable or is not
connected.t
AccessException
- if the Perforce server denies access to the callerIClient.haveList(java.util.List)
public java.util.List<IFileSpec> reopenFiles(java.util.List<IFileSpec> fileSpecs, int changeListId, java.lang.String fileType) throws ConnectionException, AccessException
IClient
reopenFiles
in interface IClient
fileSpecs
- non-null list of files to be reopenedchangeListId
- the new changelist ID to be usedfileType
- if non-null, the file is reopened as that filetype.
If the filetype given is a partial filetype, that partial
filetype is combined with the current filetype.
See 'p4 help filetypes' to attempt to make any sense of this..
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.reopenFiles(java.util.List, int, java.lang.String)
public java.util.List<IFileSpec> where(java.util.List<IFileSpec> fileSpecs) throws ConnectionException, AccessException
IClient
The returned IFiles contain all three of the depot, client, and local file paths of the corresponding fileSpec array element where appropriate, or the usual server-generated error message if there was no corresponding mapping. The main exception to this is the case when no filespecs are given (i.e. the fileSpecs array is null or empty), when the mappings for '...' (all files in the current directory and below) are returned (if they exist).
where
in interface IClient
fileSpecs
- a list of Perforce file specifications; can be empty or even
null (see explanation above).
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.where(java.util.List)
public java.util.List<IFileSpec> openedFiles(java.util.List<IFileSpec> fileSpecs, int maxFiles, int changeListId) throws ConnectionException, AccessException
IClient
The returned list can be modified with the other arguments as described below.
openedFiles
in interface IClient
fileSpecs
- if non-empty, determine the status of the specified
files; otherwise return all qualifying files known to be openmaxFiles
- if positive, return only the first maxFiles qualifying files.changeListId
- if positive, return only files associated with the given
changelist ID.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.openedFiles(java.util.List, int, int)
public java.util.List<IFileSpec> integrateFiles(int changeListId, boolean showActionsOnly, IntegrationOptions integOpts, java.lang.String branchSpec, IFileSpec fromFile, IFileSpec toFile) throws ConnectionException, AccessException
IClient
integrateFiles
in interface IClient
changeListId
- if not IChangelist.UNKNOWN, use this as the target changelistshowActionsOnly
- if true, don't actually do the integration, just return
the actions that would have been doneintegOpts
- detailed integration objects. If null, the method will use default
option values as described for the IntegrationOptions constructor,
all of which are safe for straightforward merge use.branchSpec
- if not null, use this as the integration branch specification
(as in the -b option to integ).fromFile
- if not null, use this as the source Perforce filespectoFile
- if not null, use this as the target Perforce filespec
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.integrateFiles(int, boolean, com.perforce.p4java.core.file.IntegrationOptions, java.lang.String, com.perforce.p4java.core.file.IFileSpec, com.perforce.p4java.core.file.IFileSpec)
public java.util.List<IFileSpec> resolveFilesAuto(java.util.List<IFileSpec> fileSpecs, boolean safeMerge, boolean acceptTheirs, boolean acceptYours, boolean showActionsOnly, boolean forceResolve) throws ConnectionException, AccessException
IClient
Note that this is currently a very limited version of the full Perforce resolve feature, corresponding only to (some of) the various auto-resolve features, meaning this method will never invoke (or need to invoke) end user interaction. More extensive versions of the resolve command will be surfaced as needed.
This method notionally returns an IFileSpec, as it's closely related to the integ method and shares many of its return values, but there are several limitations in the use of the returned IFileSpecs. In general, what is returned from this method is a mixture of resolution info messages (i.e. messages from the server that spell out what would or did happen during the resolve), and "true" filespecs. In the latter case, the filespec has a very limited set of valid fields: only client path, from file, and the from revisions are guaranteed to be valid. In the former case, since the info messages do NOT correspond one-to-one with the input file specs that caused the messages, consumers need to explicitly search each returned info message string for the relevant file path or name. This is an unfortunate artefact of the Perforce server's implementation of this command.
Note: results and behaviour are undefined if clashing or inconsistent options are used with this method. In general, the behaviour of (e.g.) setting both acceptYours and acceptTheirs true will be whatever the Perforce server makes of it (usually an error), but that's not guaranteed....
resolveFilesAuto
in interface IClient
fileSpecs
- files to be resolved; if null or empty, all files marked as
needing resolution will be processedsafeMerge
- if true, only do "safe" resolves, as documented for the p4 "-as" optionacceptTheirs
- if true, automatically accept "their" changes, as documented
for the p4 "-at" optionacceptYours
- if true, automatically accept "your" changes, as documented
for the p4 "-ay" optionshowActionsOnly
- if true, don't do the actual resolve, just return the
actions that would have been performed for the resolveforceResolve
- forces auto-mode resolve to accept the merged file even if
there are conflicts. This option results in a merged file that may
contain Perforce conflict markers; these markers should be edited out
of the file manually before it's submitted (unless you actually want
them there...).
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.resolveFilesAuto(java.util.List, boolean, boolean, boolean, boolean, boolean)
public IFileSpec resolveFile(IFileSpec targetFile, java.io.InputStream sourceStream) throws ConnectionException, RequestException, AccessException
IClient
Note that this method only works with the default RPC (pure Java) protocol implementations; if the underlying implementation detects a mismatch, it will throw a suitable RequestException.
Use of this method will normally result in an integration edit record in the target file's history whether you've actually done an edit or not, so it is up to the consumer to weed out the various straight copy resolve cases and only use this for cases of more complex merges that actually did involve an edit (in reality or not).
Note that the IFileSpec returned will generally not have a valid depot or client file paths -- you must use the toFile and fromFile methods on the returns here.
resolveFile
in interface IClient
targetFile
- non-null file to be resolved.sourceStream
- non-null InputStream containing the resolved file's new contents.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the caller
RequestException
IClient.resolveFile(com.perforce.p4java.core.file.IFileSpec, java.io.InputStream)
public java.util.List<IFileSpec> resolvedFiles(java.util.List<IFileSpec> fileSpecs, boolean showBaseRevision) throws ConnectionException, AccessException
IClient
resolvedFiles
in interface IClient
fileSpecs
- optional filespecs to be processedshowBaseRevision
- if true, reports the revision used as the base during
resolve (this seems to have no effect).
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.resolvedFiles(java.util.List, boolean)
public java.util.List<IFileSpec> lockFiles(java.util.List<IFileSpec> fileSpecs, int changeListId) throws ConnectionException, AccessException
IClient
The open files named are locked in the Perforce depot, preventing any user other than the current user on the current client from submitting changes to the files. If a file is already locked then the lock request is rejected. If no file specs are given then lock all files currently open in the changelist number given if it is IChangelist.DEFAULT or > 0.
Note that the file specs returned are only partially filled out; the Perforce server seems to only return path information for this command.
lockFiles
in interface IClient
fileSpecs
- candidate file specschangeListId
- if IChangelist.DEFAULT or larger than zero, lock
all files associated this changelist ID
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.lockFiles(java.util.List, int)
public java.util.List<IFileSpec> unlockFiles(java.util.List<IFileSpec> fileSpecs, int changeListId, boolean force) throws ConnectionException, AccessException
IClient
If the files are open in a specific pending changelist other than 'default', then the changeListId parameter is required to specify the pending changelist. If no file name is given then all files in the designated changelist are unlocked.
Note that the file specs returned are only partially filled out; the Perforce server seems to only return path information for this command.
unlockFiles
in interface IClient
fileSpecs
- candidate file specschangeListId
- if IChangelist.DEFAULT or larger than zero, lock
all files associated this changelist IDforce
- force the lock on non-owned filespecs. Requires appropriate
permissions.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
AccessException
- if the Perforce server denies access to the callerIClient.unlockFiles(java.util.List, int, boolean)
public java.util.List<IFileSpec> getDiffFiles(java.util.List<IFileSpec> fileSpecs, int maxFiles, boolean diffNonTextFiles, boolean openedDifferentMissing, boolean openedForIntegrate, boolean unopenedMissing, boolean unopenedDifferent, boolean unopenedWithStatus, boolean openedSame) throws ConnectionException, RequestException, AccessException
IClient
Note that this method returns lists of files, and is not useful to get the diffs themselves (at least not directly).
Note that the diff status returned for the unopenedWithStatus option is retrievable from the filespec with the getDiffStatus() method.
Note that you must have at least one of the various "-s" options set to true.
getDiffFiles
in interface IClient
fileSpecs
- candidate file specs; may be null.diffNonTextFiles
- include non-text files in the diff listsopenedDifferentMissing
- corresponds to the "-sa" option for the p4 command line.openedForIntegrate
- corresponds to the "-sb" option for the p4 command line.unopenedMissing
- corresponds to the "-sd" option for the p4 command line.unopenedDifferent
- corresponds to the "-se" option for the p4 command line.unopenedWithStatus
- corresponds to the "-sl" option for the p4 command line.openedSame
- corresponds to the "-sr" option for the p4 command line.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIClient.getDiffFiles(java.util.List, int, boolean, boolean, boolean, boolean, boolean, boolean, boolean)
public java.util.List<IFileSpec> shelveChangelist(int changelistId, java.util.List<IFileSpec> fileSpecs, boolean forceUpdate, boolean replace, boolean discard) throws ConnectionException, RequestException, AccessException
IClient
shelveChangelist
in interface IClient
changelistId
- ID of the changelist containing the files to be shelved.
Can not be IChangelist.DEFAULT or IChangelist.UNKNOWN (both of
which will cause server usage errors to be returned if used).fileSpecs
- list of files to be shelved; if null or empty, shelve all files
in the changelistforceUpdate
- if true, update the named shelved files.replace
- if true, replace the named shelved files.discard
- if truem discard the named shelved files.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIClient.shelveChangelist(int,
java.util.List, boolean, boolean, boolean)
public java.util.List<IFileSpec> shelveChangelist(IChangelist list) throws ConnectionException, RequestException, AccessException
IClient
This performs a 'p4 shelve -i' command when called.
shelveChangelist
in interface IClient
list
- non-null changelist to be shelved.
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIClient.shelveChangelist(com.perforce.p4java.core.IChangelist)
public java.util.List<IFileSpec> unshelveChangelist(int shelveChangelistId, java.util.List<IFileSpec> fileSpecs, int clientChangelistId, boolean forceOverwrite, boolean previewOnly) throws ConnectionException, RequestException, AccessException
IClient
unshelveChangelist
in interface IClient
shelveChangelistId
- id of changelist containing shelved files to unshelve (-s)fileSpecs
- optional list of file specs to limit unshelving toclientChangelistId
- id of changelist to unshelve the files into (-c)forceOverwrite
- force clobbering of files currently writeable but unopened (-f)previewOnly
- don't actually unshelve but get the file specs that would be
unshelved (-n)
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerIClient.unshelveChangelist(int,
java.util.List, int, boolean, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |