view mercurial-agent/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/AgentRepoFactory.java @ 699:fbff229ee2dc

add 'files' for log command
author eugene.petrenko@jetbrains.com
date Fri, 03 Jan 2014 14:37:04 +0100
parents 96af0d63f80a
children 31a1aca3305c
line wrap: on
line source
package jetbrains.buildServer.buildTriggers.vcs.mercurial;

import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.AuthSettings;
import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.CommandSettingsFactory;
import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.HgVcsRoot;
import jetbrains.buildServer.vcs.VcsException;
import org.jetbrains.annotations.NotNull;

import java.io.File;

public class AgentRepoFactory implements HgRepoFactory {

  private final CommandSettingsFactory myCommandSettingsFactory;
  private final HgPathProvider myHgPathProvider;

  public AgentRepoFactory(@NotNull CommandSettingsFactory commandSettingsFactory,
                          @NotNull HgPathProvider hgPathProvider) {
    myCommandSettingsFactory = commandSettingsFactory;
    myHgPathProvider = hgPathProvider;
  }

  public HgRepo createRepo(@NotNull HgVcsRoot root, @NotNull File workingDir) throws VcsException {
    return new HgRepo(myCommandSettingsFactory, workingDir, myHgPathProvider.getHgPath(root), root.getAuthSettings());
  }

  public HgRepo create(@NotNull File workingDir,
                       @NotNull String hgPath,
                       @NotNull AuthSettings authSettings) {
    return new HgRepo(myCommandSettingsFactory, workingDir, hgPath, authSettings);
  }

}