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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.lang.String> errorMessages
      Remembered error messages
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addErrorMessage​(java.lang.String message, java.lang.Exception e)  
      protected void clearErrorMessages()  
      static CommitToBranchExecuter createExecuter​(Project project)  
      abstract void findAndCommit​(Project project, java.lang.String outputBranch, java.lang.String comment, java.util.List<java.lang.String> tags, boolean unlock, boolean retainUsageVersions)
      Finds/creates the branch automatically, and then commits the given project to that branch.
      protected static java.util.List<java.lang.String> getCommitTags​(Project project, com.nomagic.magicdraw.teamwork2.ui.dialogs.L2RModulesDlg<?> dialog)  
      java.util.List<java.lang.String> getErrorMessages()  
      abstract void selectAndCommit​(Project project)
      Shows GUI allowing user to select the branch, add commit comment and tags.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • errorMessages

        private final java.util.List<java.lang.String> errorMessages
        Remembered error messages
    • 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)