Class CommitToBranchExecuter

java.lang.Object
com.nomagic.magicdraw.variants.teamwork.CommitToBranchExecuter

@OpenApiAll public abstract class CommitToBranchExecuter extends 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 Details

    • CommitToBranchExecuter

      public CommitToBranchExecuter()
  • Method Details

    • createExecuter

      @CheckForNull public static CommitToBranchExecuter createExecuter(Project project)
    • 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, String outputBranch, @CheckForNull String comment, @CheckForNull List<String> tags, boolean unlock, boolean retainUsageVersions) throws 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:
      Exception
    • addErrorMessage

      protected void addErrorMessage(String message, @CheckForNull Exception e)
    • clearErrorMessages

      protected void clearErrorMessages()
    • getErrorMessages

      public List<String> getErrorMessages()
    • getCommitTags

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