private void updateActiveVcses(boolean forceFireEvent) {
    if (!myActivated) return;
    if (myProject.isDisposed()) return;
    if (!TrustedProjects.isTrusted(myProject)) return;

    List<VcsDirectoryMapping> mappings = myMappings;
    Set<AbstractVcs> newVcses = ContainerUtil.map2SetNotNull(myMappings, this::getMappingsVcs);

    List<AbstractVcs> oldVcses;
    synchronized (myUpdateLock) {
      if (myMappings != mappings) return;

      oldVcses = myActiveVcses;
      myActiveVcses = List.copyOf(newVcses);
    }

    Collection<AbstractVcs> toAdd = ContainerUtil.subtract(myActiveVcses, oldVcses);
    Collection<AbstractVcs> toRemove = ContainerUtil.subtract(oldVcses, myActiveVcses);
    VcsActivator activator = new VcsActivator(toAdd, toRemove);

    boolean wasChanged = activator.activate();
    if (forceFireEvent || wasChanged) {
      BackgroundTaskUtil.syncPublisher(myProject, ProjectLevelVcsManagerEx.VCS_ACTIVATED).vcsesActivated(myActiveVcses);

      refreshMainMenu();
    }
  }
private void updateActiveVcses(boolean forceFireEvent)