changeset 770:5abd4de360e8

drop #withTemplates
author eugene.petrenko@jetbrains.com
date Tue, 25 Feb 2014 12:28:53 +0100
parents 50a9c2e1f0a9
children 06dcc79b304d
files mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/RepoFactory.java mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/ServerHgRepo.java mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoChangesTest.java
diffstat 3 files changed, 6 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/RepoFactory.java	Tue Feb 25 12:28:08 2014 +0100
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/RepoFactory.java	Tue Feb 25 12:28:53 2014 +0100
@@ -34,10 +34,6 @@
   protected final CommandSettingsFactory myCommandSettingsFactory;
   protected final HgPathProvider myHgPathProvider;
 
-  protected final MercurialClasspathTemplate myLogTemplate = new MercurialClasspathTemplate("/buildServerResources/log.template", "hg.log.template");
-  protected final MercurialClasspathTemplate myLogNoFilesTemplate = new MercurialClasspathTemplate("/buildServerResources/log.no.files.template", "hg.short.log.template");
-  protected final MercurialClasspathTemplate myDagTemplate = new MercurialClasspathTemplate("/buildServerResources/dag.template", "hg.dag.template");
-  protected final MercurialClasspathTemplate myFastLogTemplate = new MercurialClasspathTemplate("/buildServerResources/fastlog.template", "hg.fastlog.template");
 
   public RepoFactory(@NotNull ServerPluginConfig config,
                      @NotNull CommandSettingsFactory commandSettingsFactory,
@@ -51,11 +47,7 @@
   public ServerHgRepo create(@NotNull File workingDir,
                              @NotNull String hgPath,
                              @NotNull AuthSettings authSettings) throws VcsException {
-    return new ServerHgRepo(myCommandSettingsFactory, myConfig, workingDir, hgPath, authSettings)
-            .withLogTemplates(myLogTemplate,
-                    myLogNoFilesTemplate,
-                    myDagTemplate,
-                    myFastLogTemplate);
+    return new ServerHgRepo(myCommandSettingsFactory, myConfig, workingDir, hgPath, authSettings);
   }
 
   @NotNull
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/ServerHgRepo.java	Tue Feb 25 12:28:08 2014 +0100
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/ServerHgRepo.java	Tue Feb 25 12:28:53 2014 +0100
@@ -39,10 +39,10 @@
   private final static HgVersion REVSET_HG_VERSION = new HgVersion(1, 7, 0);
   private final CommandSettingsFactory myCommandSettingsFactory;
   private final ServerPluginConfig myConfig;
-  private MercurialTemplate myLogTemplate;
-  private MercurialTemplate myLogNoFilesTemplate;
-  private MercurialTemplate myDagTemplate;
-  private MercurialTemplate myFastLogTemplate;
+  protected final MercurialClasspathTemplate myLogTemplate = new MercurialClasspathTemplate("/buildServerResources/log.template", "hg.log.template");
+  protected final MercurialClasspathTemplate myLogNoFilesTemplate = new MercurialClasspathTemplate("/buildServerResources/log.no.files.template", "hg.short.log.template");
+  protected final MercurialClasspathTemplate myDagTemplate = new MercurialClasspathTemplate("/buildServerResources/dag.template", "hg.dag.template");
+  protected final MercurialClasspathTemplate myFastLogTemplate = new MercurialClasspathTemplate("/buildServerResources/fastlog.template", "hg.fastlog.template");
   private OperationContext myContext;
 
   public ServerHgRepo(@NotNull CommandSettingsFactory commandSettingsFactory,
@@ -59,17 +59,6 @@
     myContext = context;
   }
 
-  public ServerHgRepo withLogTemplates(@NotNull MercurialTemplate logTemplate,
-                                       @NotNull MercurialTemplate logNoFilesTemplate,
-                                       @NotNull MercurialTemplate dagTemplate,
-                                       @NotNull MercurialTemplate fastLogTemplate) {
-    myLogTemplate = logTemplate;
-    myLogNoFilesTemplate = logNoFilesTemplate;
-    myDagTemplate = dagTemplate;
-    myFastLogTemplate = fastLogTemplate;
-    return this;
-  }
-
   public LogCommand log() {
     return new LogCommand(myCommandSettingsFactory.create(), myHgPath, myWorkingDir, myAuthSettings).withTemplate(myLogTemplate);
   }
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoChangesTest.java	Tue Feb 25 12:28:08 2014 +0100
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/SubrepoChangesTest.java	Tue Feb 25 12:28:53 2014 +0100
@@ -234,11 +234,7 @@
       @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)
-                .withLogTemplates(myLogTemplate,
-                        myLogNoFilesTemplate,
-                        myDagTemplate,
-                        myFastLogTemplate);
+        return new CountingServerHgRepo(myCommandSettingsFactory, myConfig, workingDir, hgPath, authSettings, catCallCounter);
       }
     };