List<HgRevisionNumber> (VirtualFile repo) { List<String> args = new ArrayList<>(Arrays.asList( "--template", HgChangesetUtil.makeTemplate("{rev}", "{node}", "{author}", "{desc|firstline}"), "--quiet" )); addArguments(args); HgCommandResult result = executeCommandInCurrentThread(repo, args); if (result == null) { return Collections.emptyList(); } String output = result.getRawOutput(); if (StringUtil.isEmpty(output)) { return Collections.emptyList(); } String[] changesets = output.split(HgChangesetUtil.CHANGESET_SEPARATOR); List<HgRevisionNumber> revisions = new ArrayList<>(changesets.length); for(String changeset: changesets) { List<String> parts = StringUtil.split(changeset, HgChangesetUtil.ITEM_SEPARATOR); if (parts.size() >= 3) { //support zero commit message revisions.add(HgRevisionNumber.getInstance(parts.get(0), parts.get(1), parts.get(2), parts.size() > 3 ? parts.get(3) : "")); } else { LOG.warn("Could not parse changeset [" + changeset + "]"); } } return revisions; }