diff options
author | Tor Norbye <tnorbye@google.com> | 2014-08-21 00:31:02 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-08-16 04:55:08 +0000 |
commit | 9cde0e3c015174898df8b8f3672185941fad4786 (patch) | |
tree | 80a55c7b59c38377216daaada4e8bc47b69ceb9a /plugins/hg4idea/src/org/zmlx/hg4idea/command/HgOutgoingCommand.java | |
parent | 3b37877a2561bf9fbe072253a18688807d523505 (diff) | |
parent | d76e3920c56d37c942092b7dca20fcaded81c0a5 (diff) | |
download | idea-9cde0e3c015174898df8b8f3672185941fad4786.tar.gz |
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
Diffstat (limited to 'plugins/hg4idea/src/org/zmlx/hg4idea/command/HgOutgoingCommand.java')
-rw-r--r-- | plugins/hg4idea/src/org/zmlx/hg4idea/command/HgOutgoingCommand.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgOutgoingCommand.java b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgOutgoingCommand.java index 64f155064ead..578af65a6b56 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgOutgoingCommand.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/command/HgOutgoingCommand.java @@ -12,11 +12,19 @@ // limitations under the License. package org.zmlx.hg4idea.command; +import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.zmlx.hg4idea.execution.HgCommandResult; +import org.zmlx.hg4idea.execution.HgRemoteCommandExecutor; +import org.zmlx.hg4idea.log.HgHistoryUtil; import org.zmlx.hg4idea.util.HgUtil; +import java.util.LinkedList; +import java.util.List; + public class HgOutgoingCommand extends HgRemoteChangesetsCommand { public HgOutgoingCommand(Project project) { @@ -27,4 +35,23 @@ public class HgOutgoingCommand extends HgRemoteChangesetsCommand { protected String getRepositoryUrl(VirtualFile root) { return HgUtil.getRepositoryDefaultPushPath(project, root); } + + @Nullable + public HgCommandResult execute(@NotNull VirtualFile repo, + @NotNull String template, + @NotNull String source, + @NotNull String destination, + boolean doNotShowAuthorizationRequest) { + + List<String> arguments = new LinkedList<String>(); + arguments.add("-n"); + arguments.add("--template"); + arguments.add(template); + arguments.add(HgHistoryUtil.prepareParameter("rev", source)); + arguments.add(destination); + HgRemoteCommandExecutor commandExecutor = + new HgRemoteCommandExecutor(project, destination, ModalityState.any(), doNotShowAuthorizationRequest); + commandExecutor.setOutputAlwaysSuppressed(true); + return commandExecutor.executeInCurrentThread(repo, "outgoing", arguments); + } } |