|
|||||||||
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<java.lang.Void> org.tmatesoft.svn.core.wc2.SvnMerge
public class SvnMerge
Represents merge operation.
There are three possible cases of merge operation.
If revision ranges (ranges
) are provided, merges the changes
between source
in its pegRevision
,
as it changed between the ranges
in to
the working copy path defined in operation's target
.
If revision ranges are not provided, merges changes from firstSource
/its pegRevision
to
secondSource
/its pegRevision
into the working copy path
defined in operation's target
.
The third case is if reintegrate
is true
performs
a reintegration merge of source
at its pegRevision
into working copy target
.
depth
is SVNDepth.INFINITY
, merges fully
recursively. Else if SVNDepth.IMMEDIATES
, merges changes at most
to files that are immediate children of target
and to
directory properties of target
and its immediate
subdirectory children. Else if SVNDepth.FILES
, merges at most to
immediate file children of target
and to
target
itself. Else if SVNDepth.EMPTY
, applies
changes only to target
(i.e., directory property changes
only).
If depth
is SVNDepth.UNKNOWN
, uses the depth of
target
.
Uses ignoreAncestry
to control whether or not items being
diffed will be checked for relatedness first. Unrelated items are
typically transmitted to the editor as a deletion of one thing and the
addition of another, but if this flag is false
, unrelated items will be diffed as if
they were related.
If force
is not set and the merge involves deleting locally
modified or unversioned items the operation will fail. If
force
is set such items will be deleted.
Merge options mergeOptions
is a collection of SVNDiffOptions
,
they are used to pass arguments to the merge processes (internal or external).
If the caller's ISVNEventHandler
is not null
,
then it will be called once for each merged target.
If recordOnly
is true
, the
merge isn't actually performed, but the mergeinfo for the revisions which
would've been merged is recorded in the working copy (and must be
subsequently committed back to the repository).
If dryRun
is true
, the
merge is carried out, and full notification feedback is provided, but the
working copy is not modified.
Ranges
is a collection of SvnRevisionRange
ranges. These ranges may describe additive and/or subtractive merge
ranges, they may overlap fully or partially, and/or they may partially or
fully negate each other. This range list is not required to be sorted.
FirstSource
and secondSource
must both represent the same node
kind - that is, if firstSource
is a directory, secondSource
must also be, and if firstSource
is a file, secondSource
must
also be.
target
must be a single-revision, SVNDepth.INFINITY
,
pristine, unswitched working copy - in other words, it must reflect a
single revision tree, the "target". The mergeinfo on source
must reflect that all of the target has been merged into it.
The depth of the merge is always SVNDepth.INFINITY
.
If source
's pegRevision
is
null
or invalid
, then it defaults to
SVNRevision.HEAD
.
SvnOperation.run()
method throws org.tmatesoft.svn.core.SVNException in
the following cases:
SVNErrorCode.CLIENT_BAD_REVISION
-
If any revision in the list of provided ranges is
invalid
exception with SVNErrorCode.CLIENT_BAD_REVISION
error code - if either firstSource
's pegRevision
or
firstSource
's pegRevision
is invalid
Constructor Summary | |
---|---|
protected |
SvnMerge(SvnOperationFactory factory)
|
Method Summary | |
---|---|
void |
addRevisionRange(SvnRevisionRange range)
Adds the revision range to collection of revision ranges for merging. |
SvnTarget |
getFirstSource()
Returns first source for merge between two sources. |
SVNDiffOptions |
getMergeOptions()
Returns the operation's merge options controlling white-spaces and eol-styles. |
java.util.Collection<SvnRevisionRange> |
getRevisionRanges()
Returns the collection of SvnRevisionRange
ranges. |
SvnTarget |
getSecondSource()
Returns second source for merge between two sources. |
SvnTarget |
getSource()
Returns source for merge between revisions and reintegrate merge. |
boolean |
isAllowMixedRevisions()
Returns whether to allow merge target to have mixed revisions. |
boolean |
isChangesWorkingCopy()
Gets whether the operation changes working copy |
boolean |
isDryRun()
Returns whether the merge is carried out, and full notification feedback is provided, but the working copy is not modified. |
boolean |
isForce()
Returns whether to fail if merge involves deleting locally modified or unversioned items. |
boolean |
isIgnoreAncestry()
Returns whether or not items being diffed will be checked for relatedness first. |
boolean |
isRecordOnly()
Returns whether the merge isn't actually performed, but the mergeinfo for the revisions which would've been merged is recorded in the working copy (and must be subsequently committed back to the repository). |
boolean |
isReintegrate()
Returns whether it is reintegrate merge. |
void |
setAllowMixedRevisions(boolean allowMixedRevisions)
Sets whether to allow merge target to have mixed revisions. |
void |
setDryRun(boolean dryRun)
Sets whether the merge is carried out, and full notification feedback is provided, but the working copy is not modified. |
void |
setForce(boolean force)
Sets whether to fail if merge involves deleting locally modified or unversioned items. |
void |
setIgnoreAncestry(boolean ignoreAncestry)
Sets whether or not items being diffed will be checked for relatedness first. |
void |
setMergeOptions(SVNDiffOptions mergeOptions)
Sets the operation's merge options controlling white-spaces and eol-styles. |
void |
setRecordOnly(boolean recordOnly)
Sets whether the merge isn't actually performed, but the mergeinfo for the revisions which would've been merged is recorded in the working copy (and must be subsequently committed back to the repository). |
void |
setSource(SvnTarget source,
boolean reintegrate)
Sets source of the merge with reintegrate flag. |
void |
setSources(SvnTarget source1,
SvnTarget source2)
Sets first and seconds sources of the merge. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SvnMerge(SvnOperationFactory factory)
Method Detail |
---|
public void addRevisionRange(SvnRevisionRange range)
range
- revision range for mergegetRevisionRanges()
public java.util.Collection<SvnRevisionRange> getRevisionRanges()
SvnRevisionRange
ranges. These ranges may describe additive and/or subtractive merge
ranges, they may overlap fully or partially, and/or they may partially or
fully negate each other. This range list is not required to be sorted.
public void setSource(SvnTarget source, boolean reintegrate)
source
is used in merge between revisions
and reintegrate merge.
source
- of mergereintegrate
- true
if it is reintegrate merge, otherwise false
isReintegrate()
public void setSources(SvnTarget source1, SvnTarget source2)
source1
- first sourcesource2
- second sourcepublic SvnTarget getSource()
public SvnTarget getFirstSource()
public SvnTarget getSecondSource()
public boolean isReintegrate()
true
if it is reintegrate merge, otherwise false
public boolean isIgnoreAncestry()
false
, unrelated items will be diffed as if
they were related.
true
if ancestry should be ignored, otherwise false
public void setIgnoreAncestry(boolean ignoreAncestry)
false
, unrelated items will be diffed as if
they were related.
ignoreAncestry
- true
if ancestry should be ignored, otherwise false
public boolean isForce()
force
is true
such items will be deleted,
otherwise operation will fail.
true
if operation should be forced to run, otherwise false
public void setForce(boolean force)
force
is true
such items will be deleted,
otherwise operation will fail.
force
- true
if operation should be forced to run, otherwise false
public boolean isRecordOnly()
true
if operation should record only the result of merge - mergeinfo data, otherwise false
public void setRecordOnly(boolean recordOnly)
recordOnly
- true
if operation should record only the result of merge - mergeinfo data, otherwise false
public boolean isDryRun()
true
if the operation should only find out if a file can be merged successfully, otherwise false
public void setDryRun(boolean dryRun)
dryRun
- true
if the operation should only find out if a file can be merged successfully, otherwise false
public boolean isAllowMixedRevisions()
false
and target has mixed revisions, SVNException
is
thrown with error codes SVNErrorCode.CLIENT_NOT_READY_TO_MERGE
or SVNErrorCode.CLIENT_MERGE_UPDATE_REQUIRED
.
true
if operation allows merging to mixed-revision working copy, otherwise false
public void setAllowMixedRevisions(boolean allowMixedRevisions)
false
and target has mixed revisions, SVNException
is
thrown with error codes SVNErrorCode.CLIENT_NOT_READY_TO_MERGE
or SVNErrorCode.CLIENT_MERGE_UPDATE_REQUIRED
.
allowMixedRevisions
- true
if operation allows merging to mixed-revision working copy, otherwise false
public SVNDiffOptions getMergeOptions()
public void setMergeOptions(SVNDiffOptions mergeOptions)
mergeOptions
- merge options of the operationpublic boolean isChangesWorkingCopy()
isChangesWorkingCopy
in class SvnOperation<java.lang.Void>
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 |