public interface RTEGitMergeCommand extends RTAbstractCommand
This command applies JGit Merge command MergeCommand
with special merge strategy which is aware about models and can use content-type specific
mergers when performing file merge.
The command supports several merge types:
MergeType.FileByFile
- This is default merge type. Each file is processed separately. If there is a registered IStorageMerger
for given file type, then it will be used for content merge.
MergeType.Logical
- Logical merge. All UML models in current workspace are grouped into logical models. Each logical model is processed as
single entity while performing merge operation. All non-UML files are processed in the same was as with FileByFile merge type.
MergeType.Closure
Closure merge. All UML models in current workspace are processed as single entity while performing merge operation.
All non-UML files are processed in the same was as with FileByFile merge type. Client can customize what models should be included into closure via
closure filter.
Logical and closure merge can be used only if models were imported in the current workspace. Client may use option setAutoImport(boolean autoImport)
to allow automatic import of affected Eclipse projects into workspace. The automatic import is based on analysis of commits involved in the merge process.
The merge is performed asynchronously in separate thread. Client should use setCompletionCallback(MergeCompletionCallback callback)
to
register callback which will be notified when merge is completed.
Modifier and Type | Interface and Description |
---|---|
static interface |
RTEGitMergeCommand.MergeCompletionCallback
Defines interface for callback which is notified when merge operation is completed.
|
Modifier and Type | Method and Description |
---|---|
RTEGitMergeCommand |
setAutoCheckout(boolean status)
Automatically checkout target branch before merge
|
RTEGitMergeCommand |
setAutoCommit(boolean autoCommit)
Controls whether the merge command should automatically commit after a
successful merge.
|
RTEGitMergeCommand |
setAutoImport(boolean autoImport)
Perform auto-import of affected project during compare/merge operation
Default value: disabled
|
RTEGitMergeCommand |
setClosureFilter(IClosureFilter filter)
Defines filter for closure operation.
|
RTEGitMergeCommand |
setClosureFilter(java.lang.String filter)
Defines filter for closure operation.
|
RTEGitMergeCommand |
setCompletionCallback(RTEGitMergeCommand.MergeCompletionCallback callback)
Set callback which will be notified when merge operation is completed.
|
RTEGitMergeCommand |
setFastForwardMode(org.eclipse.jgit.api.MergeCommand.FastForwardMode mode)
Set fast-forward mode.
|
RTEGitMergeCommand |
setMergeType(MergeType type)
Set merge type.
|
RTEGitMergeCommand |
setPartialMode(boolean partialMode)
Enables/disables partial mode.
|
RTEGitMergeCommand |
setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor monitor)
Set progress monitor for current command
|
RTEGitMergeCommand |
setRepository(java.io.File repository)
Set path to existing Git repository
|
RTEGitMergeCommand |
setSource(java.lang.String ref)
Set source branch/ref/commit for the merge
|
RTEGitMergeCommand |
setSquash(boolean squash)
Enables/disables squash mode for merge.
|
RTEGitMergeCommand |
setTarget(java.lang.String ref)
Set target branch/ref/commit for the merge.
|
call
RTEGitMergeCommand setRepository(java.io.File repository)
repository
- - path to Git repository. Path may or may not include '.git' folder. Paths '/dir1/dir2/dir3' and '/dir1/dir2/dir3/.git' are considered the sameRTEGitMergeCommand setSource(java.lang.String ref)
ref
- - branch name, reference or commit idRTEGitMergeCommand setTarget(java.lang.String ref)
ref
- - branch name, reference or commit idRTEGitMergeCommand setAutoCheckout(boolean status)
status
- RTEGitMergeCommand setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor monitor)
monitor
- RTEGitMergeCommand setMergeType(MergeType type)
type
- - MergeType
RTEGitMergeCommand setFastForwardMode(org.eclipse.jgit.api.MergeCommand.FastForwardMode mode)
MergeCommand.FastForwardMode
for details.mode
- - MergeCommand.FastForwardMode
RTEGitMergeCommand setAutoCommit(boolean autoCommit)
false
.autoCommit
- RTEGitMergeCommand setAutoImport(boolean autoImport)
autoImport
- RTEGitMergeCommand setPartialMode(boolean partialMode)
Partial mode allows to save partially merged models and mark as conflicting only really conflicting files.
Default value: disabledpartialMode
- RTEGitMergeCommand setSquash(boolean squash)
squash
- RTEGitMergeCommand setClosureFilter(java.lang.String filter)
filter
- - comma-separated list of paths. Each path may include '*' or '?' symbolsRTEGitMergeCommand setClosureFilter(IClosureFilter filter)
filter
- - an object implementing IClosureFilter
interfaceRTEGitMergeCommand setCompletionCallback(RTEGitMergeCommand.MergeCompletionCallback callback)
callback
- - RTEGitMergeCommand.MergeCompletionCallback