private void updateInBackground(@Nullable VirtualFile root) {
    if (!isCheckingEnabled(myProject)) return;
    if (!myUpdateStarted.compareAndSet(false, true)) return;
    new Task.Backgroundable(myProject, getProgressTitle(), true) {
      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        if (myProject.isDisposed()) return;
        final VirtualFile[] roots = root != null ? new VirtualFile[]{root}
                                                 : ProjectLevelVcsManager.getInstance(myProject).getRootsUnderVcs(myVcs);
        updateChangesStatusSynchronously(myProject, roots, myIncomingStatus, true);
        updateChangesStatusSynchronously(myProject, roots, myOutgoingStatus, false);

        BackgroundTaskUtil.syncPublisher(myProject, HgVcs.INCOMING_OUTGOING_CHECK_TOPIC).update();
      }

      @Override
      public void onFinished() {
        myUpdateStarted.set(false);
      }
    }.queue();
  }
private void updateInBackground(@Nullable VirtualFile root)