Mercurial > hg > mercurial
view mercurial/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/command/TipCommand.java @ 22:0d6f27953b30
synchronization fixes
author | Pavel.Sher |
---|---|
date | Thu, 17 Jul 2008 00:58:04 +0400 |
parents | 6989ac0f8cac |
children | 7047f643747f |
line wrap: on
line source
package jetbrains.buildServer.buildTriggers.vcs.mercurial.command; import com.intellij.execution.configurations.GeneralCommandLine; import jetbrains.buildServer.ExecResult; import jetbrains.buildServer.vcs.VcsException; import org.jetbrains.annotations.NotNull; import java.util.List; /** * @author Pavel.Sher * Date: 14.07.2008 */ public class TipCommand { @NotNull private Settings mySettings; public TipCommand(@NotNull final Settings settings) { mySettings = settings; } @NotNull public ChangeSet execute() throws VcsException { GeneralCommandLine cli = new GeneralCommandLine(); cli.setWorkDirectory(mySettings.getWorkingDir().getAbsolutePath()); cli.setExePath(mySettings.getHgCommandPath()); cli.addParameter("tip"); ExecResult res = CommandUtil.runCommand(cli); List<ChangeSet> changeSets = LogCommand.parseChangeSets(res.getStdout()); if (changeSets.isEmpty()) { CommandUtil.commandFailed("hg tip", res); } return changeSets.get(0); } }