Class SvnMerge

  • All Implemented Interfaces:
    ISvnOperationOptionsProvider

    public class SvnMerge
    extends SvnOperation<java.lang.Void>
    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.
    • Merge between sources/revision ranges, no reintegration.

      If 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.

      • Merge between revision ranges.

        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.

      • Merge between two sources.

        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.

    • Reintegration merge.

      This kind of merge should be used for back merging (for example, merging branches back to trunk, in which case merge is carried out by comparing the latest trunk tree with the latest branch tree; i.e. the resulting difference is exactly the branch changes which will go back to trunk).

      Destination 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.

    Note: this operation requires repository access.

    SvnOperation.run() method throws org.tmatesoft.svn.core.SVNException in the following cases:

Version:
1.7