// called NOT under ChangeListManagerImpl lock
  public void notifyStartProcessingChanges(final VcsModifiableDirtyScope scope) {
    final Collection<Change> oldChanges = new ArrayList<Change>();
    for (LocalChangeList list : myMap.values()) {
      final Collection<Change> affectedChanges =
          ((LocalChangeListImpl) list).startProcessingChanges(myProject, scope);
      if (!affectedChanges.isEmpty()) {
        oldChanges.addAll(affectedChanges);
      }
    }
    for (Change change : oldChanges) {
      myIdx.changeRemoved(change);
    }
    // scope should be modified for correct moves tracking
    correctScopeForMoves(scope, oldChanges);

    myLocallyDeleted.cleanAndAdjustScope(scope);
    mySwitchedHolder.cleanAndAdjustScope(scope);
  }
  public void notifyDoneProcessingChanges(final ChangeListListener dispatcher) {
    List<ChangeList> changedLists = new ArrayList<ChangeList>();
    final Map<LocalChangeListImpl, List<Change>> removedChanges =
        new HashMap<LocalChangeListImpl, List<Change>>();
    final Map<LocalChangeListImpl, List<Change>> addedChanges =
        new HashMap<LocalChangeListImpl, List<Change>>();
    for (LocalChangeList list : myMap.values()) {
      final List<Change> removed = new ArrayList<Change>();
      final List<Change> added = new ArrayList<Change>();
      final LocalChangeListImpl listImpl = (LocalChangeListImpl) list;
      if (listImpl.doneProcessingChanges(removed, added)) {
        changedLists.add(list);
      }
      if (!removed.isEmpty()) {
        removedChanges.put(listImpl, removed);
      }
      if (!added.isEmpty()) {
        addedChanges.put(listImpl, added);
      }
    }
    for (Map.Entry<LocalChangeListImpl, List<Change>> entry : removedChanges.entrySet()) {
      dispatcher.changesRemoved(entry.getValue(), entry.getKey());
    }
    for (Map.Entry<LocalChangeListImpl, List<Change>> entry : addedChanges.entrySet()) {
      dispatcher.changesAdded(entry.getValue(), entry.getKey());
    }
    for (ChangeList changeList : changedLists) {
      dispatcher.changeListChanged(changeList);
    }
    mySwitchedHolder.calculateChildren();

    for (String name : myListsToDisappear) {
      final LocalChangeList changeList = myMap.get(name);
      if ((changeList != null)
          && changeList.getChanges().isEmpty()
          && (!changeList.isReadOnly())
          && (!changeList.isDefault())) {
        removeChangeList(name);
      }
    }
    myListsToDisappear.clear();
  }
 public void notifyVcsStarted(AbstractVcs vcs) {
   myLocallyDeleted.notifyVcsStarted(vcs);
   mySwitchedHolder.notifyVcsStarted(vcs);
 }
 public boolean isSwitched(final VirtualFile file) {
   return mySwitchedHolder.containsFile(file);
 }
 public String getBranchForFile(final VirtualFile file) {
   return mySwitchedHolder.getBranchForFile(file);
 }
 public void removeSwitched(final VirtualFile file) {
   mySwitchedHolder.removeFile(file);
 }
 public void addSwitched(
     final VirtualFile file, @NotNull String branchName, final boolean recursive) {
   mySwitchedHolder.addFile(file, branchName, recursive);
 }
 public SwitchedFileHolder getSwitchedHolder() {
   return mySwitchedHolder.copy();
 }