public void invalidate(final UpdatedFiles updatedFiles) {
    final Map<String, RemoteDifferenceStrategy> strategyMap;
    synchronized (myLock) {
      strategyMap = new HashMap<String, RemoteDifferenceStrategy>(myKinds);
    }
    final Collection<String> newForTree = new LinkedList<String>();
    final Collection<String> newForUsual = new LinkedList<String>();
    UpdateFilesHelper.iterateAffectedFiles(
        updatedFiles,
        new Consumer<Pair<String, String>>() {
          public void consume(final Pair<String, String> pair) {
            final String vcsName = pair.getSecond();
            RemoteDifferenceStrategy strategy = strategyMap.get(vcsName);
            if (strategy == null) {
              final AbstractVcs vcs = myVcsManager.findVcsByName(vcsName);
              if (vcs == null) return;
              strategy = vcs.getRemoteDifferenceStrategy();
            }
            if (RemoteDifferenceStrategy.ASK_TREE_PROVIDER.equals(strategy)) {
              newForTree.add(pair.getFirst());
            } else {
              newForUsual.add(pair.getFirst());
            }
          }
        });

    myRemoteRevisionsStateCache.invalidate(newForTree);
    myRemoteRevisionsNumbersCache.invalidate(newForUsual);
  }
Esempio n. 2
0
 private void refreshChangeListsFindConflicts(final UpdatedFiles updatedFiles) {
   UpdateFilesHelper.iterateFileGroupFiles(
       updatedFiles,
       new UpdateFilesHelper.Callback() {
         public void onFile(final String filePath, final String groupId) {
           final VirtualFile vf = SvnUtil.getVirtualFile(filePath);
           if (vf != null) {
             // refresh base directory so that conflict files should be detected
             // file itself is already refreshed
             vf.getParent().refresh(false, false);
             myDirtyScopeManager.fileDirty(vf);
           }
           if (FileGroup.MERGED_WITH_CONFLICT_ID.equals(groupId)) {
             myConflictedVirtualFiles.add(vf);
           }
         }
       });
 }