Package org.eclipse.team.core.mapping
Interface IStorageMerger
- All Known Implementing Classes:
DelegatingStorageMerger
public interface IStorageMerger
This interface defines a single operation for performing a three-way merge on three
instances of
IStorage
. The merged result is written to an output stream.
Clients must implement this interface when contributing new mergers to the
org.eclipse.team.core.storageMergers
extension point.
- Since:
- 3.2
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Indicates that a change conflict prevented the merge from successful completion (value1
)static final int
Status code describing an internal error (value2
)static final int
Indicates the successful completion of the merge operation (valueIStatus.OK
)static final int
Indicates that at least one of the encodings associated with the input was unsupported (value3
) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Return whether this merger can merge the two contributors without an ancestor.merge
(OutputStream output, String outputEncoding, IStorage ancestor, IStorage target, IStorage other, IProgressMonitor monitor) Performs a merge operation on the given storage instances and writes the merge result to the output stream.
-
Field Details
-
OK
static final int OKIndicates the successful completion of the merge operation (valueIStatus.OK
)- See Also:
-
CONFLICT
static final int CONFLICTIndicates that a change conflict prevented the merge from successful completion (value1
)- See Also:
-
INTERNAL_ERROR
static final int INTERNAL_ERRORStatus code describing an internal error (value2
)- See Also:
-
UNSUPPORTED_ENCODING
static final int UNSUPPORTED_ENCODINGIndicates that at least one of the encodings associated with the input was unsupported (value3
)- See Also:
-
-
Method Details
-
merge
IStatus merge(OutputStream output, String outputEncoding, IStorage ancestor, IStorage target, IStorage other, IProgressMonitor monitor) throws CoreException Performs a merge operation on the given storage instances and writes the merge result to the output stream. On success a statusIStatus.OK
is returned, on error a statusIStatus.ERROR
. If the merge operation cannot deal with conflicts, the code of the error status has the valueIStreamMerger.CONFLICT
. For text oriented mergers the encoding for the input and output is honored if they implementIEncodedStorage
. It is the responsibility of callers to close the output stream.The provided ancestor may be
null
if this merger returnstrue
fromcanMergeWithoutAncestor()
.- Parameters:
output
- the byte stream to which the merge result is written; the merger will not close the streamoutputEncoding
- the encoding to use when writing to the output streamancestor
- the storage from which the common ancestor is readtarget
- the storage containing the target of the mergeother
- the storage containing the target of the mergemonitor
- reports progress of the merge operation- Returns:
- returns the completion status of the operation
- Throws:
CoreException
- if an error occurs
-
canMergeWithoutAncestor
boolean canMergeWithoutAncestor()Return whether this merger can merge the two contributors without an ancestor. This is typically not possible but may be for some file types (for instances, files that contain a timestamp based list of events).- Returns:
- whether this merger can merge the two contributors without an ancestor
-