Search in sources :

Example 6 with HgRemoteCommandExecutor

use of org.zmlx.hg4idea.execution.HgRemoteCommandExecutor in project intellij-community by JetBrains.

the class HgPushCommand method executeInCurrentThread.

public HgCommandResult executeInCurrentThread() {
    final List<String> arguments = new LinkedList<>();
    if (!StringUtil.isEmptyOrSpaces(myRevision)) {
        arguments.add("-r");
        arguments.add(myRevision);
    }
    if (myBranchName != null) {
        arguments.add("-b");
        arguments.add(myBranchName);
    }
    if (myIsNewBranch) {
        arguments.add("--new-branch");
    }
    if (!StringUtil.isEmptyOrSpaces(myBookmarkName)) {
        arguments.add("-B");
        arguments.add(myBookmarkName);
    }
    if (myForce) {
        arguments.add("-f");
    }
    arguments.add(myDestination);
    final HgRemoteCommandExecutor executor = new HgRemoteCommandExecutor(myProject, myDestination);
    executor.setShowOutput(true);
    HgCommandResult result = executor.executeInCurrentThread(myRepo, "push", arguments);
    myProject.getMessageBus().syncPublisher(HgVcs.REMOTE_TOPIC).update(myProject, null);
    return result;
}
Also used : HgCommandResult(org.zmlx.hg4idea.execution.HgCommandResult) HgRemoteCommandExecutor(org.zmlx.hg4idea.execution.HgRemoteCommandExecutor) LinkedList(java.util.LinkedList)

Aggregations

HgRemoteCommandExecutor (org.zmlx.hg4idea.execution.HgRemoteCommandExecutor)6 LinkedList (java.util.LinkedList)4 Nullable (org.jetbrains.annotations.Nullable)3 HgCommandResult (org.zmlx.hg4idea.execution.HgCommandResult)3 HgCommandResultNotifier (org.zmlx.hg4idea.action.HgCommandResultNotifier)2 Notification (com.intellij.notification.Notification)1 NotificationListener (com.intellij.notification.NotificationListener)1 ArrayList (java.util.ArrayList)1 HyperlinkEvent (javax.swing.event.HyperlinkEvent)1 HgProjectSettings (org.zmlx.hg4idea.HgProjectSettings)1 HgVcs (org.zmlx.hg4idea.HgVcs)1