svn: Refactored MergeChecker - used SvnChangeList instance (instead of just revision...
authorKonstantin Kolosovsky <konstantin.kolosovsky@jetbrains.com>
Wed, 4 Mar 2015 05:08:00 +0000 (08:08 +0300)
committerKonstantin Kolosovsky <konstantin.kolosovsky@jetbrains.com>
Wed, 4 Mar 2015 05:08:00 +0000 (08:08 +0300)
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/ToBeMergedDialog.java
plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/MergeChecker.java
plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/OneShotMergeInfoHelper.java

index 7eb3b62c3ddc58c3154ae644e80e07dece3f8520..d1ec9715ae450ae7d49c11d18d5cdeb4fcf5f0b3 100644 (file)
@@ -265,7 +265,7 @@ public class ToBeMergedDialog extends DialogWrapper implements MergeDialogI {
           final List<SvnChangeList> svnChangeLists = ContainerUtil.findAll(changeLists, SvnChangeList.class);
 
           for (SvnChangeList svnChangeList : svnChangeLists) {
-            final Collection<String> notMerged = myMergeChecker.getNotMergedPaths(svnChangeList.getNumber());
+            final Collection<String> notMerged = myMergeChecker.getNotMergedPaths(svnChangeList);
 
             if (!ContainerUtil.isEmpty(notMerged)) {
               for (String path : svnChangeList.getAffectedPaths()) {
index e8fc08f4c7d05ccb5897e82aad24f0811f31cec1..6e6e66571c8c589445b4641354476bf4afce8502 100644 (file)
@@ -1,12 +1,20 @@
 package org.jetbrains.idea.svn.mergeinfo;
 
+import com.intellij.openapi.vcs.VcsException;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.jetbrains.idea.svn.history.SvnChangeList;
 
 import java.util.Collection;
 
 public interface MergeChecker {
-  SvnMergeInfoCache.MergeCheckResult checkList(SvnChangeList list);
+
+  void prepare() throws VcsException;
+
+  @NotNull
+  SvnMergeInfoCache.MergeCheckResult checkList(@NotNull SvnChangeList changeList);
 
   // if nothing, maybe all not merged or merged: here only partly not merged
-  Collection<String> getNotMergedPaths(long number);
+  @Nullable
+  Collection<String> getNotMergedPaths(@NotNull SvnChangeList changeList);
 }
index bdd13c820acb533dccd899aa813f577e96c08ae6..aa42733c4ed5c89e38c20006df018e7e7b0249c8 100644 (file)
@@ -64,6 +64,7 @@ public class OneShotMergeInfoHelper implements MergeChecker {
     });
   }
 
+  @Override
   public void prepare() throws VcsException {
     Depth depth = Depth.allOrEmpty(myMergeContext.getVcs().getSvnConfiguration().isCheckNestedForQuickMerge());
     File file = myMergeContext.getWcInfo().getRootInfo().getIoFile();
@@ -73,8 +74,8 @@ public class OneShotMergeInfoHelper implements MergeChecker {
   }
 
   @Nullable
-  public Collection<String> getNotMergedPaths(long number) {
-    return myPartiallyMerged.get(number);
+  public Collection<String> getNotMergedPaths(@NotNull SvnChangeList changeList) {
+    return myPartiallyMerged.get(changeList.getNumber());
   }
 
   @NotNull