|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tmatesoft.svn.core.wc2.SvnOperation<T> org.tmatesoft.svn.core.wc2.SvnReceivingOperation<SVNCommitInfo> org.tmatesoft.svn.core.wc2.AbstractSvnCommit org.tmatesoft.svn.core.wc2.SvnCommit
public class SvnCommit
Represents commit operation. Commits files or directories into repository.
Iftargets
has zero elements, then do nothing and return
immediately without error.
If the caller's event handler
is not
null
it will be called as the commit
progresses with any of the following actions:
SVNEventAction.COMMIT_MODIFIED
,
SVNEventAction.COMMIT_ADDED
,
SVNEventAction.COMMIT_DELETED
,
SVNEventAction.COMMIT_REPLACED
. If the commit succeeds, the
handler will be called with SVNEventAction.COMMIT_COMPLETED
event
action.
If depth
is SVNDepth.INFINITY
, commits all changes
to and below named targets. If depth
is
SVNDepth.EMPTY
, commits only named targets (that is, only
property changes on named directory targets, and property and content
changes for named file targets). If depth
is
SVNDepth.FILES
, behaves as above for named file targets, and for
named directory targets, commits property changes on a named directory
and all changes to files directly inside that directory. If
SVNDepth.IMMEDIATES
, behaves as for SVNDepth.FILES
, and
for subdirectories of any named directory target
commits as though for
SVNDepth.EMPTY
.
Unlocks paths in the repository, unless keepLocks
is true
.
changelists
used as a restrictive filter on items that are committed; that is,
doesn't commit anything unless it's a member of one of those changelists.
After the commit completes successfully, removes changelist associations
from the targets, unless keepChangelist
is set. If
changelists
is empty (or altogether null
), no changelist filtering occurs.
If no exception is thrown and SVNCommitInfo.getNewRevision()
is
invalid (<0
), then the commit was a no-op; nothing needed
to be committed.
run()
returns SVNCommitInfo
information about new committed revision.
run()
throws SVNException
in the following cases:
SVNErrorCode.UNSUPPORTED_FEATURE
error code
- if it is commit from different working copies belonging to different repositories
exception with SVNErrorCode.CLIENT_PROPERTY_NAME
error code
- if there is standard Subversion property among revision properties
exception with SVNErrorCode.WC_FOUND_CONFLICT
error code
- if item is remaining in conflict
exception with SVNErrorCode.ILLEGAL_TARGET
error code
- if item is not under version control
or item's parent is not known to exist in the repository and is not part of the commit, yet item is part of the commit
exception with SVNErrorCode.WC_PATH_NOT_FOUND
error code
- if item is scheduled for addition within unversioned parent
or item is scheduled for addition, but is missing
exception with SVNErrorCode.NODE_UNKNOWN_KIND
error code
- if item is of unknown kind
exception with SVNErrorCode.NODE_UNEXPECTED_KIND
error code
- item has unexpectedly changed special status
exception with SVNErrorCode.WC_NOT_LOCKED
error code
- if working copy directory/file is missing
exception with SVNErrorCode.CLIENT_DUPLICATE_COMMIT_URL
error code
- if operation trying to commit different items referring to the same URL
exception with SVNErrorCode.BAD_URL
error code
- if working copy directory/file is missing
exception with SVNErrorCode.WC_NOT_LOCKED
error code
- if operation cannot compute base URL for commit operation
exception with SVNErrorCode.WC_CORRUPT_TEXT_BASE
error code
- if working copy is corrupted
Constructor Summary | |
---|---|
protected |
SvnCommit(SvnOperationFactory factory)
|
Method Summary | |
---|---|
SvnCommitPacket |
collectCommitItems()
Returns operation's commit packet. |
protected void |
ensureArgumentsAreValid()
|
ISvnCommitParameters |
getCommitParameters()
Gets operation's parameters of the commit. |
protected int |
getMaximumTargetsCount()
|
boolean |
isChangesWorkingCopy()
Gets whether the operation changes working copy |
boolean |
isForce()
Sets whether or not to force a non-recursive commit; if depth
is SVNDepth.INFINITY the force flag is ignored. |
boolean |
isKeepChangelists()
Gets whether or not changelists should be removed. |
boolean |
isKeepLocks()
Gets whether or not to unlock files in the repository. |
SVNCommitInfo |
run()
If commit packet is null , calls collectCommitItems()
to create the commit packet, then executes the operation. |
void |
setCommitParameters(ISvnCommitParameters commitParameters)
Sets operation's parameters of the commit. |
void |
setForce(boolean force)
Gets whether or not to force a non-recursive commit; if depth
is SVNDepth.INFINITY the force flag is ignored. |
void |
setKeepChangelists(boolean keepChangelists)
Sets whether or not changelists should be removed. |
void |
setKeepLocks(boolean keepLocks)
Sets whether or not to unlock files in the repository. |
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 SvnCommit(SvnOperationFactory factory)
Method Detail |
---|
public boolean isKeepChangelists()
changelists
should be removed.
true
if changelists
should be removed, otherwise false
public void setKeepChangelists(boolean keepChangelists)
changelists
should be removed.
keepChangelists
- true
if changelists
should be removed, otherwise false
public boolean isKeepLocks()
true
if files should not be unlocked in the repository, otherwise false
public void setKeepLocks(boolean keepLocks)
keepLocks
- true
if files should not be unlocked in the repository, otherwise false
public ISvnCommitParameters getCommitParameters()
ISvnCommitParameters
public void setCommitParameters(ISvnCommitParameters commitParameters)
commitParameters
- commit parameters of the operationISvnCommitParameters
public SvnCommitPacket collectCommitItems() throws SVNException
SvnOperationFactory.collectCommitItems(SvnCommit)
if commit packet is null
.
SVNException
public SVNCommitInfo run() throws SVNException
null
, calls collectCommitItems()
to create the commit packet, then executes the operation.
run
in class SvnOperation<SVNCommitInfo>
SVNException
protected void ensureArgumentsAreValid() throws SVNException
ensureArgumentsAreValid
in class SvnOperation<SVNCommitInfo>
SVNException
protected int getMaximumTargetsCount()
getMaximumTargetsCount
in class SvnOperation<SVNCommitInfo>
public void setForce(boolean force)
depth
is SVNDepth.INFINITY
the force
flag is ignored.
force
- true
if non-recursive commit should be forced, otherwise false
public boolean isForce()
depth
is SVNDepth.INFINITY
the force
flag is ignored.
true
if non-recursive commit should be forced, otherwise false
public 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 |