changeset 769:50a9c2e1f0a9

simplify 2
author eugene.petrenko@jetbrains.com
date Tue, 25 Feb 2014 12:28:08 +0100
parents f2e43b4d3558
children 5abd4de360e8
files mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/OperationContext.java
diffstat 2 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Tue Feb 25 12:23:05 2014 +0100
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Tue Feb 25 12:28:08 2014 +0100
@@ -681,17 +681,19 @@
     }
   }
 
+  @NotNull
   public ServerHgRepo createRepo(@NotNull HgVcsRoot root) throws VcsException {
-    return myRepoFactory.create(getWorkingDir(root), myHgPathProvider.getHgPath(root), root.getAuthSettings());
+    return myRepoFactory.createRepo(root, getWorkingDir(root));
   }
 
+  @NotNull
   public ServerHgRepo createRepo(@NotNull OperationContext ctx, @NotNull HgVcsRoot root) throws VcsException {
-    return ctx.createRepo(getWorkingDir(root), myHgPathProvider.getHgPath(root), root.getAuthSettings());
+    return ctx.createRepo(root, getWorkingDir(root));
   }
 
-
-  public HgRepo createRepo(@NotNull HgVcsRoot root, @NotNull File customDir) throws VcsException {
-    return myRepoFactory.create(customDir, myHgPathProvider.getHgPath(root), root.getAuthSettings());
+  @NotNull
+  public ServerHgRepo createRepo(@NotNull HgVcsRoot root, @NotNull File customDir) throws VcsException {
+    return myRepoFactory.createRepo(root, customDir);
   }
 
   @NotNull
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/OperationContext.java	Tue Feb 25 12:23:05 2014 +0100
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/OperationContext.java	Tue Feb 25 12:28:08 2014 +0100
@@ -18,10 +18,10 @@
 
 import com.intellij.openapi.util.Pair;
 import gnu.trove.TLongObjectHashMap;
-import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.AuthSettings;
 import jetbrains.buildServer.buildTriggers.vcs.mercurial.command.HgVcsRoot;
 import jetbrains.buildServer.util.Hash;
-import jetbrains.buildServer.util.graph.*;
+import jetbrains.buildServer.util.graph.BFSVisitorAdapter;
+import jetbrains.buildServer.util.graph.DAG;
 import jetbrains.buildServer.vcs.ModificationData;
 import jetbrains.buildServer.vcs.RepositoryStateData;
 import jetbrains.buildServer.vcs.VcsException;
@@ -117,11 +117,13 @@
   }
 
   @NotNull
-  public ServerHgRepo createRepo(@NotNull File workingDir, @NotNull String hgPath, @NotNull AuthSettings authSettings) throws VcsException {
+  public ServerHgRepo createRepo(@NotNull final HgVcsRoot root, @NotNull final File workingDir) throws VcsException {
     ServerHgRepo repo = myRepos.get(workingDir);
-    if (repo != null)
+    if (repo != null) {
       return repo;
-    repo = myRepoFactory.create(workingDir, hgPath, authSettings);
+    }
+
+    repo = myRepoFactory.createRepo(root, workingDir);
     repo.setOperationContext(this);
     myRepos.put(workingDir, repo);
     return repo;
@@ -208,7 +210,7 @@
                                                       @NotNull String fromRevision,
                                                       @NotNull String toRevision) throws VcsException {
     syncRepository(root);
-    ServerHgRepo repo = createRepo(myVcs.getWorkingDir(root), myHgPathProvider.getHgPath(root), root.getAuthSettings());
+    ServerHgRepo repo = createRepo(root, myVcs.getWorkingDir(root));
 
     if (!repo.supportRevsets())
       return singleton(fromRevision);