|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.tmatesoft.svn.core.wc2.SvnOperation<T>
org.tmatesoft.svn.core.wc2.SvnReceivingOperation<SVNCommitInfo>
org.tmatesoft.svn.core.wc2.AbstractSvnCommit
org.tmatesoft.svn.core.wc2.SvnRemoteCopy
public class SvnRemoteCopy
Represents copy to repository operation.
Copies each source in sources to operation's target destination.
Target should represent repository URL.
sources are given, target must be a
directory, and sources will be copied as children of
target.
Each src in sources must be files or
directories under version control, or URLs of a versioned item in the
repository. If sources has multiple items, they must be all
repository URLs or all working copy paths.
The parent of target must already exist.
If sources has only one item, attempts to copy it to
target. If failWhenDstExists is false and target already exists,
attempts to copy the item as a child of target If
failWhenDstExists is true
and target already exists, throws an SVNException with
the SVNErrorCode.FS_ALREADY_EXISTS error code.
If sources has multiple items, and
failWhenDstExists is false,
all sources are copied as children of target. If
any child of target already exists with the same name any item
in sources, throws an SVNException with the
SVNErrorCode.FS_ALREADY_EXISTS error code.
If sources has multiple items, and
failWhenDstExists is true,
throws an SVNException with the
SVNErrorCode.CLIENT_MULTIPLE_SOURCES_DISALLOWED.
Authentication manager (whether
provided directly through the appropriate constructor or in an
ISVNRepositoryPool instance) and commit handler are used to immediately attempt to commit the copy action
in the repository.
If the caller's ISVNEventHandler is non-null, invokes it for each item added at the
new location.
When performing a wc-to-url copy (tagging|branching from a working copy)
it's possible to fix revisions of external working copies (if any) which
are located within the working copy being copied. For example, imagine
you have a working copy and on one of its subdirectories you set an
"svn:externals" property which does not contain
a revision number. Suppose you have made a tag from your working copy and
in some period of time a user checks out that tag. It could have happened
that the external project has evolved since the tag creation moment and
the tag version is no more compatible with it. So, the user has a broken
project since it will not compile because of the API incompatibility
between the two versions of the external project: the HEAD one and the
one existed in the moment of the tag creation. That is why it appears
useful to fix externals revisions during a wc-to-url copy. To enable
externals revision fixing a user should implement
ISVNExternalsHandler. The user's implementation
ISVNExternalsHandler.handleExternal(File,SVNURL,SVNRevision,SVNRevision,String,SVNRevision)
method will be called on every external that will be met in the working
copy. If the user's implementation returns non-null
external revision, it's compared with the
revisions fetched from the external definition. If they are different,
the user's revision will be written in the external definition of the
tag. Otherwise if the returned revision is equal to the revision from the
external definition or if the user's implementation returns null
for that external, it will be skipped (i.e. left as is, unprocessed).
Note: this routine requires repository access.
run() returns SVNCommitInfo commit information information about the new committed revision.
| Constructor Summary | |
|---|---|
protected |
SvnRemoteCopy(SvnOperationFactory factory)
|
| Method Summary | |
|---|---|
void |
addCopySource(SvnCopySource source)
And one source to the operation's sources. |
ISvnCommitParameters |
getCommitParameters()
Returns operation's parameters of the commit. |
ISvnExternalsHandler |
getExternalsHandler()
Gets operation's externals handler. |
java.util.Collection<SvnCopySource> |
getSources()
Returns all operation's sources. |
boolean |
isChangesWorkingCopy()
Gets whether the operation changes working copy |
boolean |
isDisableLocalModifications()
Sets whether to disable local modifications. |
boolean |
isFailWhenDstExists()
Gets whether to fail if target already exists. |
boolean |
isMakeParents()
Gets whether to make parent folders if don't exist. |
boolean |
isMove()
Gets whether to do copy as move operation (delete, then add with history). |
SVNCommitInfo |
run()
Runs copy operation. |
void |
setCommitParameters(ISvnCommitParameters commitParameters)
Sets operation's parameters of the commit. |
void |
setDisableLocalModifications(boolean disableLocalModifications)
Sets whether to disable local modifications. |
void |
setExternalsHandler(ISvnExternalsHandler externalsHandler)
Sets operation's externals handler. |
void |
setFailWhenDstExists(boolean failWhenDstExists)
Sets whether to fail if target already exists. |
void |
setMakeParents(boolean makeParents)
Sets whether to make parent folders if don't exist. |
void |
setMove(boolean move)
Sets whether to do copy as move operation (delete, then add with history). |
| Methods inherited from class org.tmatesoft.svn.core.wc2.AbstractSvnCommit |
|---|
getCommitHandler, getCommitMessage, getRevisionProperties, setCommitHandler, setCommitMessage, setRevisionProperties, setRevisionProperty |
| Methods inherited from class org.tmatesoft.svn.core.wc2.SvnReceivingOperation |
|---|
first, getReceiver, initDefaults, last, receive, run, setReceiver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SvnRemoteCopy(SvnOperationFactory factory)
| Method Detail |
|---|
public boolean isMove()
true if move operation should be done, otherwise falsepublic void setMove(boolean move)
move - true if move operation should be done, otherwise falsepublic boolean isMakeParents()
true if non-existent parent directories should be created, otherwise falsepublic void setMakeParents(boolean makeParents)
makeParents - true if non-existent parent directories should be created, otherwise falsepublic boolean isDisableLocalModifications()
true if local modifications are disabled, otherwise falsesetDisableLocalModifications(boolean)public void setDisableLocalModifications(boolean disableLocalModifications)
true and any local modification is found,
run() method throws SVNException exception with SVNErrorCode.ILLEGAL_TARGET code.
disableLocalModifications - true if local modifications are disabled, otherwise falsepublic java.util.Collection<SvnCopySource> getSources()
SvnRemoteCopypublic void addCopySource(SvnCopySource source)
source - source of the operationSvnRemoteCopypublic boolean isFailWhenDstExists()
target already exists.
true if fail when target already exists, otherwise falseSvnRemoteCopypublic void setFailWhenDstExists(boolean failWhenDstExists)
target already exists.
failWhenDstExists - true if fail when target already exists, otherwise falseSvnRemoteCopy
public SVNCommitInfo run()
throws SVNException
run in class SvnOperation<SVNCommitInfo>SVNCommitInfo commit information information about the new committed revision.
SVNExceptionpublic ISvnExternalsHandler getExternalsHandler()
SvnRemoteCopypublic void setExternalsHandler(ISvnExternalsHandler externalsHandler)
externalsHandler - externals handler of the operationSvnRemoteCopypublic ISvnCommitParameters getCommitParameters()
default ones.
ISvnCommitParameterspublic void setCommitParameters(ISvnCommitParameters commitParameters)
defaultones
are used.
commitParameters - commit parameters of the operationISvnCommitParameterspublic boolean isChangesWorkingCopy()
isChangesWorkingCopy in class SvnOperation<SVNCommitInfo>true if the operation changes the working copy, otherwise false
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||