diff options
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); + } } |