From a1b5320c8c6c3420e8ba78242225797d79b5c92d Mon Sep 17 00:00:00 2001 From: Irina Chernushina Date: Mon, 17 Aug 2009 01:02:11 +0400 Subject: [PATCH] VCS: CME in RemoteRevisionsCache --- .../openapi/vcs/changes/RemoteRevisionsCache.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsCache.java b/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsCache.java index 86309a2662..ee9fe57757 100644 --- a/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsCache.java +++ b/vcs-impl/src/com/intellij/openapi/vcs/changes/RemoteRevisionsCache.java @@ -138,19 +138,22 @@ public class RemoteRevisionsCache implements PlusMinus public void directoryMappingChanged() { synchronized (myLock) { - for (Map.Entry> entry : myData.entrySet()) { - final String key = entry.getKey(); - final VcsRoot storedVcsRoot = entry.getValue().getFirst(); + final HashSet keys = new HashSet(myData.keySet()); + for (String key : keys) { + final Pair value = myData.get(key); + final VcsRoot storedVcsRoot = value.getFirst(); final VirtualFile vf = myLfs.refreshAndFindFileByIoFile(new File(key)); final AbstractVcs newVcs = (vf == null) ? null : myVcsManager.getVcsFor(vf); - final VirtualFile newRoot = getRootForPath(key); - final VcsRoot newVcsRoot = new VcsRoot(newVcs, newRoot); if (newVcs == null) { myData.remove(key); getQueue(storedVcsRoot).forceRemove(key); - } else if (! storedVcsRoot.equals(newVcsRoot)) { - switchVcs(storedVcsRoot, newVcsRoot, key); + } else { + final VirtualFile newRoot = myVcsManager.getVcsRootFor(vf); + final VcsRoot newVcsRoot = new VcsRoot(newVcs, newRoot); + if (! storedVcsRoot.equals(newVcsRoot)) { + switchVcs(storedVcsRoot, newVcsRoot, key); + } } } } -- 2.11.4.GIT