com.ibm.xtools.umldt.rt.api.egit.merge

Interface RTEGitMergeCommand

  • All Superinterfaces:
    RTAbstractCommand
    All Known Implementing Classes:
    RTEGitMergeCommandImpl


    public interface RTEGitMergeCommand
    extends RTAbstractCommand
    Defines interface for EGit merge command.

    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.

    Author:
    seroshki
    • Method Detail

      • setRepository

        RTEGitMergeCommand setRepository(File repository)
        Set path to existing Git repository
        Parameters:
        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 same
      • setSource

        RTEGitMergeCommand setSource(String ref)
        Set source branch/ref/commit for the merge
        Parameters:
        ref - - branch name, reference or commit id
      • setTarget

        RTEGitMergeCommand setTarget(String ref)
        Set target branch/ref/commit for the merge. Default value is 'HEAD'. Client can use auto-checkout option to enable automatic checkout of the target branch.
        Parameters:
        ref - - branch name, reference or commit id
      • setAutoCheckout

        RTEGitMergeCommand setAutoCheckout(boolean status)
        Automatically checkout target branch before merge
        Parameters:
        status -
      • setProgressMonitor

        RTEGitMergeCommand setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor monitor)
        Set progress monitor for current command
        Parameters:
        monitor -
      • setFastForwardMode

        RTEGitMergeCommand setFastForwardMode(org.eclipse.jgit.api.MergeCommand.FastForwardMode mode)
        Set fast-forward mode. See MergeCommand.FastForwardMode for details.
        Parameters:
        mode - - MergeCommand.FastForwardMode
        Returns:
      • setAutoCommit

        RTEGitMergeCommand setAutoCommit(boolean autoCommit)
        Controls whether the merge command should automatically commit after a successful merge. Default value is false.
        Parameters:
        autoCommit -
        Returns:
      • setAutoImport

        RTEGitMergeCommand setAutoImport(boolean autoImport)
        Perform auto-import of affected project during compare/merge operation Default value: disabled
        Parameters:
        autoImport -
      • setPartialMode

        RTEGitMergeCommand setPartialMode(boolean partialMode)
        Enables/disables partial mode. This option has meaning only when using closure or logical merge.

        Partial mode allows to save partially merged models and mark as conflicting only really conflicting files.

        Default value: disabled
        Parameters:
        partialMode -
      • setSquash

        RTEGitMergeCommand setSquash(boolean squash)
        Enables/disables squash mode for merge. See Git documentation for details. Default value: false
        Parameters:
        squash -
      • setClosureFilter

        RTEGitMergeCommand setClosureFilter(String filter)
        Defines filter for closure operation. The filter will be used to group UML models into closure. All resources matching filter will be processed as single closure. If closure filter is not specified, the entire workspace will be use as closure
        Parameters:
        filter - - comma-separated list of paths. Each path may include '*' or '?' symbols
      • setClosureFilter

        RTEGitMergeCommand setClosureFilter(IClosureFilter filter)
        Defines filter for closure operation. The filter will be used to group UML models into closure. All resources matching filter will be processed as single closure. If closure filter is not specified, the entire workspace will be use as closure
        Parameters:
        filter - - an object implementing IClosureFilter interface