Class CommitToBranchExecuter


  • @OpenApiAll
    public abstract class CommitToBranchExecuter
    extends java.lang.Object
    Commits the provided remote project to the selected branch (that can only be the branch of the same remote project). The resulting version of the branch is identical to the source project. Current changes to the original (source) project itself are not committed/saved.
    • Constructor Detail

      • CommitToBranchExecuter

        public CommitToBranchExecuter()
    • Method Detail

      • selectAndCommit

        public abstract void selectAndCommit​(Project project)
        Shows GUI allowing user to select the branch, add commit comment and tags. Then should call commitToBranch()
      • findAndCommit

        public abstract void findAndCommit​(Project project,
                                           java.lang.String outputBranch,
                                           @CheckForNull
                                           java.lang.String comment,
                                           @CheckForNull
                                           java.util.List<java.lang.String> tags,
                                           boolean unlock,
                                           boolean retainUsageVersions)
                                    throws java.lang.Exception
        Finds/creates the branch automatically, and then commits the given project to that branch. Implementation of this method should not use any user interaction/GUI
        Parameters:
        project - source to get the state from
        outputBranch - string to find in the given project. If branch does not exit, it should be created.
        comment - informative commit comment
        tags - optional commit tags
        unlock - true to unlock user's currently locked elements in the output branch
        retainUsageVersions - true to preserve project usage versions in the output branch. Providing false will update versions from the source project
        Throws:
        java.lang.Exception
      • addErrorMessage

        protected void addErrorMessage​(java.lang.String message,
                                       @CheckForNull
                                       java.lang.Exception e)
      • clearErrorMessages

        protected void clearErrorMessages()
      • getErrorMessages

        public java.util.List<java.lang.String> getErrorMessages()
      • getCommitTags

        protected static java.util.List<java.lang.String> getCommitTags​(Project project,
                                                                        com.nomagic.magicdraw.teamwork2.ui.dialogs.L2RModulesDlg<?> dialog)