# HG changeset patch # User eugene.petrenko@jetbrains.com # Date 1393328170 -3600 # Node ID 06dcc79b304dc70d0f082c98c63d28d79ada2ec9 # Parent 5abd4de360e874e677cb3ae8f5c2e2f2d04dc9f9 use API only diff -r 5abd4de360e8 -r 06dcc79b304d mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/RepoFactory.java --- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/RepoFactory.java Tue Feb 25 12:28:53 2014 +0100 +++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/RepoFactory.java Tue Feb 25 12:36:10 2014 +0100 @@ -44,15 +44,17 @@ } @NotNull - public ServerHgRepo create(@NotNull File workingDir, - @NotNull String hgPath, - @NotNull AuthSettings authSettings) throws VcsException { - return new ServerHgRepo(myCommandSettingsFactory, myConfig, workingDir, hgPath, authSettings); + protected ServerHgRepo create(@NotNull File workingDir, + @NotNull String hgPath, + @NotNull AuthSettings authSettings, + @NotNull CommandSettingsFactory commandSettingsFactory, + @NotNull ServerPluginConfig config) { + return new ServerHgRepo(commandSettingsFactory, config, workingDir, hgPath, authSettings); } @NotNull public ServerHgRepo createRepo(@NotNull HgVcsRoot root, @NotNull File workingDir) throws VcsException { - return create(workingDir, myHgPathProvider.getHgPath(root), root.getAuthSettings()); + return create(workingDir, myHgPathProvider.getHgPath(root), root.getAuthSettings(), myCommandSettingsFactory, myConfig); } public void dispose() { diff -r 5abd4de360e8 -r 06dcc79b304d mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java --- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java Tue Feb 25 12:28:53 2014 +0100 +++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupportTest.java Tue Feb 25 12:36:10 2014 +0100 @@ -581,8 +581,6 @@ if (!SystemInfo.isUnix) return; - RepoFactory repoFactory = new RepoFactory(myPluginConfig, new TestCommandSettingsFactory(), myHgPathProvider); - //create a file on the server File dirOnTheServer = myTempFiles.createTempDir(); File fileOnTheServer = new File(dirOnTheServer, "file.on.server"); @@ -590,7 +588,7 @@ //create a remote repository with symlink pointing to the file on the server File repository = copyRepository(myTempFiles, simpleRepo()); - ServerHgRepo repo = repoFactory.create(repository, getHgPath(), new AuthSettings()); + ServerHgRepo repo = new ServerHgRepo(new TestCommandSettingsFactory(), myPluginConfig, repository, getHgPath(), new AuthSettings()); repo.update().toRevision("9c6a6b4aede0").call(); new ProcessBuilder("ln", "-s", dirOnTheServer.getCanonicalPath()).directory(repository).start().waitFor(); new ProcessBuilder(getHgPath(), "add", dirOnTheServer.getName()).directory(repository).start().waitFor(); diff -r 5abd4de360e8 -r 06dcc79b304d mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoChangesTest.java --- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoChangesTest.java Tue Feb 25 12:28:53 2014 +0100 +++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoChangesTest.java Tue Feb 25 12:36:10 2014 +0100 @@ -16,10 +16,7 @@ package jetbrains.buildServer.buildTriggers.vcs.mercurial; -import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.AuthSettings; -import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.CatCommand; -import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.CommandSettingsFactory; -import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.TestCommandSettingsFactory; +import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.*; import jetbrains.buildServer.vcs.*; import org.jetbrains.annotations.NotNull; import org.testng.annotations.BeforeMethod; @@ -233,8 +230,8 @@ RepoFactory repoFactory = new RepoFactory(pluginConfig, new TestCommandSettingsFactory(), myHgPathProvider) { @NotNull @Override - public ServerHgRepo create(@NotNull File workingDir, @NotNull String hgPath, @NotNull AuthSettings authSettings) throws VcsException { - return new CountingServerHgRepo(myCommandSettingsFactory, myConfig, workingDir, hgPath, authSettings, catCallCounter); + protected ServerHgRepo create(@NotNull File workingDir, @NotNull String hgPath, @NotNull AuthSettings authSettings, @NotNull CommandSettingsFactory commandSettingsFactory, @NotNull ServerPluginConfig config) { + return new CountingServerHgRepo(commandSettingsFactory, config, workingDir, hgPath, authSettings, catCallCounter); } };