changeset 877:45311425ee3c

Remove unused field HgPathProvider wasn't used in OperationContext. Remove it from all the places where it was needed only to create the context.
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Fri, 03 Oct 2014 22:29:27 +0200
parents b2816067699a
children 593c37cb219d
files mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialCollectChangesPolicy.java mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialModificationInfoBuilder.java mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/OperationContext.java mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialSupportBuilder.java
diffstat 5 files changed, 7 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialCollectChangesPolicy.java	Wed Oct 01 22:03:19 2014 +0200
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialCollectChangesPolicy.java	Fri Oct 03 22:29:27 2014 +0200
@@ -40,20 +40,17 @@
   private final ServerPluginConfig myConfig;
   private final HgVcsRootFactory myHgVcsRootFactory;
   private final RepoFactory myRepoFactory;
-  private final HgPathProvider myHgPathProvider;
 
   public MercurialCollectChangesPolicy(@NotNull VcsOperationProgressProvider progressProvider,
                                        @NotNull MercurialVcsSupport vcs,
                                        @NotNull ServerPluginConfig config,
                                        @NotNull HgVcsRootFactory hgVcsRootFactory,
-                                       @NotNull RepoFactory repoFactory,
-                                       @NotNull HgPathProvider hgPathProvider) {
+                                       @NotNull RepoFactory repoFactory) {
     myProgressProvider = progressProvider;
     myVcs = vcs;
     myConfig = config;
     myHgVcsRootFactory = hgVcsRootFactory;
     myRepoFactory = repoFactory;
-    myHgPathProvider = hgPathProvider;
   }
 
 
@@ -99,7 +96,7 @@
                                                @NotNull CheckoutRules rules) throws VcsException {
     List<ModificationData> changes = new ArrayList<ModificationData>();
     HgVcsRoot hgRoot = myHgVcsRootFactory.createHgRoot(root);
-    OperationContext ctx = new OperationContext(myVcs, myRepoFactory, myHgPathProvider, fromState, toState);
+    OperationContext ctx = new OperationContext(myVcs, myRepoFactory, fromState, toState);
     ctx.setProgressConsumer(createProgressConsumer());
     for (Map.Entry<String, String> entry : toState.getBranchRevisions().entrySet()) {
       String branch = entry.getKey();
@@ -152,7 +149,7 @@
                                                @NotNull CheckoutRules checkoutRules) throws VcsException {
     if (currentVersion == null)
       return emptyList();
-    OperationContext ctx = new OperationContext(myVcs, myRepoFactory, myHgPathProvider, fromVersion, currentVersion);
+    OperationContext ctx = new OperationContext(myVcs, myRepoFactory, fromVersion, currentVersion);
     ctx.setProgressConsumer(createProgressConsumer());
     List<ModificationData> changes = collectChanges(ctx, root, asList(fromVersion), currentVersion, checkoutRules);
     changes.addAll(getSubrepoChanges(ctx, root, changes));
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialModificationInfoBuilder.java	Wed Oct 01 22:03:19 2014 +0200
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialModificationInfoBuilder.java	Fri Oct 03 22:29:27 2014 +0200
@@ -50,7 +50,6 @@
 
     final OperationContext ctx = new OperationContext(myVcs,
             myRepoFactory,
-            myHgPathProvider,
             Collections.<String>emptyList(),
             RepositoryStateData.createVersionState("", Collections.<String, String>emptyMap()));
 
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Wed Oct 01 22:03:19 2014 +0200
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Fri Oct 03 22:29:27 2014 +0200
@@ -58,7 +58,6 @@
   private final VcsOperationProgressProvider myProgressProvider;
   private final MirrorManager myMirrorManager;
   private final ServerPluginConfig myConfig;
-  private final HgPathProvider myHgPathProvider;
   private final RepoFactory myRepoFactory;
   private final HgVcsRootFactory myHgVcsRootFactory;
   private final FileFilter myIgnoreDotHgFilter = new IgnoreDotHgFilter();
@@ -71,7 +70,6 @@
                              @NotNull final EventDispatcher<ServerListener> dispatcher,
                              @NotNull final ResetCacheRegister resetCacheHandlerManager,
                              @NotNull final ServerPluginConfig config,
-                             @NotNull final HgPathProvider hgPathProvider,
                              @NotNull final RepoFactory repoFactory,
                              @NotNull final MirrorManager mirrorManager,
                              @NotNull final HgVcsRootFactory hgVcsRootFactory,
@@ -80,7 +78,6 @@
     myProgressProvider = progressProvider;
     myConfig = config;
     myMirrorManager = mirrorManager;
-    myHgPathProvider = hgPathProvider;
     myRepoFactory = repoFactory;
     myHgVcsRootFactory = hgVcsRootFactory;
     myTestConnection = testConnection;
@@ -624,7 +621,7 @@
 
   @NotNull
   public MercurialCollectChangesPolicy getCollectChangesPolicy() {
-    return new MercurialCollectChangesPolicy(myProgressProvider, this, myConfig, myHgVcsRootFactory, myRepoFactory, myHgPathProvider);
+    return new MercurialCollectChangesPolicy(myProgressProvider, this, myConfig, myHgVcsRootFactory, myRepoFactory);
   }
 
 
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/OperationContext.java	Wed Oct 01 22:03:19 2014 +0200
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/OperationContext.java	Fri Oct 03 22:29:27 2014 +0200
@@ -40,7 +40,6 @@
 
   private final MercurialVcsSupport myVcs;
   private final RepoFactory myRepoFactory;
-  private final HgPathProvider myHgPathProvider;
   private final Set<String> myUninterestingRevisions;
   private final RepositoryStateData myToState;
   private final Map<VcsRootKey, DAG<String>> myDags = new HashMap<VcsRootKey, DAG<String>>();
@@ -55,28 +54,24 @@
 
   public OperationContext(@NotNull MercurialVcsSupport vcs,
                           @NotNull RepoFactory repoFactory,
-                          @NotNull HgPathProvider hgPathProvider,
                           @NotNull RepositoryStateData fromState,
                           @NotNull RepositoryStateData toState) {
-    this(vcs, repoFactory, hgPathProvider, new HashSet<String>(fromState.getBranchRevisions().values()), toState);
+    this(vcs, repoFactory, new HashSet<String>(fromState.getBranchRevisions().values()), toState);
   }
 
   public OperationContext(@NotNull MercurialVcsSupport vcs,
                           @NotNull RepoFactory repoFactory,
-                          @NotNull HgPathProvider hgPathProvider,
                           @NotNull String fromVersion,
                           @NotNull String toVersion) {
-    this(vcs, repoFactory, hgPathProvider, setOf(fromVersion), RepositoryStateData.createSingleVersionState(toVersion));
+    this(vcs, repoFactory, setOf(fromVersion), RepositoryStateData.createSingleVersionState(toVersion));
   }
 
   public OperationContext(@NotNull MercurialVcsSupport vcs,
                           @NotNull RepoFactory repoFactory,
-                          @NotNull HgPathProvider hgPathProvider,
                           @NotNull Collection<String> fromVersions,
                           @NotNull RepositoryStateData toState) {
     myVcs = vcs;
     myRepoFactory = repoFactory;
-    myHgPathProvider = hgPathProvider;
     myToState = toState;
     myUninterestingRevisions = new HashSet<String>(fromVersions);
   }
--- a/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialSupportBuilder.java	Wed Oct 01 22:03:19 2014 +0200
+++ b/mercurial-tests/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialSupportBuilder.java	Fri Oct 03 22:29:27 2014 +0200
@@ -62,7 +62,7 @@
     myContext.checking(new Expectations() {{
       allowing(resetCacheManager).registerHandler(with(any(ResetCacheHandler.class)));
     }});
-    MercurialVcsSupport vcs = new MercurialVcsSupport(new MockVcsOperationProgressProvider(), dispatcher, resetCacheManager, myConfig, myHgPathProvider,
+    MercurialVcsSupport vcs = new MercurialVcsSupport(new MockVcsOperationProgressProvider(), dispatcher, resetCacheManager, myConfig,
             myRepoFactory, mirrorManager, myHgRootFactory, testConnection, new SubrepoCheckoutRulesProviderImpl());
     vcs.addExtensions(myExtensions);
     return vcs;