void (Project project, VirtualFile[] roots, HgChangesetStatus status, boolean incoming) { if (!isCheckingEnabled(project)) return; final List<HgRevisionNumber> changesets = new LinkedList<>(); for (VirtualFile root : roots) { if (incoming) { changesets.addAll(new HgIncomingCommand(project).executeInCurrentThread(root)); } else { changesets.addAll(new HgOutgoingCommand(project).executeInCurrentThread(root)); } } status.setChanges(changesets.size(), new ChangesetFormatter(status, changesets)); }