public static void updateRepoTo(final @NotNull Project project,
                                  final @NotNull VirtualFile repository,
                                  final @NotNull @NonNls String targetRevision,
                                  final boolean clean,
                                  final @Nullable Runnable callInAwtLater) {
    new Task.Backgroundable(project, HgBundle.message("action.hg4idea.updateTo.description")) {
      @Override
      public void onSuccess() {
        if (callInAwtLater != null) {
          callInAwtLater.run();
        }
      }

      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        updateRepoToInCurrentThread(project, repository, targetRevision, clean);
      }
    }.queue();
  }
public static void updateRepoTo(final @NotNull Project project,
                                  final @NotNull VirtualFile repository,
                                  final @NotNull @NonNls String targetRevision,
                                  final boolean clean,
                                  final @Nullable Runnable callInAwtLater)