public void commit()

in src/org/jetbrains/tfsIntegration/ui/checkoutwizard/ChooseWorkspaceStep.java [107:152]


  public void commit(CommitType commitType) throws CommitStepException {
    if (myModel.getMode() == CheckoutWizardModel.Mode.Manual) {
      final WorkspaceInfo workspace = myManageWorkspacesForm.getSelectedWorkspace();
      if (workspace != null) {
        myModel.setServer(workspace.getServer());
      }
      myModel.setWorkspace(workspace);
      if (commitType == CommitType.Next || commitType == CommitType.Finish) {
        // let's select first mapped path for newly selected workspace
        try {
          // workspace can't be null here
          //noinspection ConstantConditions
          workspace.loadFromServer(null, true);
          final List<WorkingFolderInfo> workingFolders = workspace.getWorkingFolders(null);
          if (!workingFolders.isEmpty()) {
            myModel.setServerPath(workingFolders.get(0).getServerPath());
          }
          else {
            String message = MessageFormat.format("Workspace ''{0}'' has no mappings.", workspace.getName());
            throw new CommitStepException(message);
          }
        }
        catch (UserCancelledException e) {
          throw new CommitStepCancelledException();
        }
        catch (TfsException e) {
          throw new CommitStepException(e.getMessage());
        }
      }
    }
    else {
      final ServerInfo server = myManageWorkspacesForm.getSelectedServer();
      myModel.setServer(server);
      if (commitType == CommitType.Next || commitType == CommitType.Finish) {
        try {
          TfsServerConnectionHelper.ensureAuthenticated(myManageWorkspacesForm.getContentPane(), server.getUri(), true);
        }
        catch (UserCancelledException e) {
          throw new CommitStepCancelledException();
        }
        catch (TfsException e) {
          throw new CommitStepException(e.getMessage());
        }
      }
    }
  }