Package org.eclipse.team.core.mapping
Interface IStorageMerger
-
- All Known Implementing Classes:
DelegatingStorageMerger
public interface IStorageMergerThis interface defines a single operation for performing a three-way merge on three instances ofIStorage. The merged result is written to an output stream.Clients must implement this interface when contributing new mergers to the
org.eclipse.team.core.storageMergersextension point.- Since:
- 3.2
-
-
Field Summary
Fields Modifier and Type Field Description static intCONFLICTIndicates that a change conflict prevented the merge from successful completion (value1)static intINTERNAL_ERRORStatus code describing an internal error (value2)static intOKIndicates the successful completion of the merge operation (valueIStatus.OK)static intUNSUPPORTED_ENCODINGIndicates that at least one of the encodings associated with the input was unsupported (value3)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanMergeWithoutAncestor()Return whether this merger can merge the two contributors without an ancestor.IStatusmerge(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 Detail
-
OK
static final int OK
Indicates the successful completion of the merge operation (valueIStatus.OK)- See Also:
- Constant Field Values
-
CONFLICT
static final int CONFLICT
Indicates that a change conflict prevented the merge from successful completion (value1)- See Also:
- Constant Field Values
-
INTERNAL_ERROR
static final int INTERNAL_ERROR
Status code describing an internal error (value2)- See Also:
- Constant Field Values
-
UNSUPPORTED_ENCODING
static final int UNSUPPORTED_ENCODING
Indicates that at least one of the encodings associated with the input was unsupported (value3)- See Also:
- Constant Field Values
-
-
Method Detail
-
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.OKis 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
nullif this merger returnstruefromcanMergeWithoutAncestor().- 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
-
-