void (final @Nullable Runnable runAfterUpdate) { final String newContent = myNeedToUpdateFileContent ? getContentFromModel() : null; myNeedToUpdateFileContent = false; new Task.Backgroundable(myProject, HgBundle.message("action.hg4idea.mq.updating", myRepository.getPresentableUrl())) { @Override public void run(@NotNull ProgressIndicator indicator) { if (newContent != null) { writeSeriesFile(newContent); } if (runAfterUpdate != null) { runAfterUpdate.run(); } } }.queue(); }