public List<Pair<IFileSpec, IFileRevisionData>> getExactHistory(IOptionsServer server, List<IFileSpec> specs)
throws P4JavaException {
GetRevisionHistoryOptions opts = new GetRevisionHistoryOptions()
.setMaxRevs(1)
.setContentHistory(false)
.setIncludeInherited(false)
.setLongOutput(true)
.setTruncatedLongOutput(false);
Map<IFileSpec, List<IFileRevisionData>> res = server.getRevisionHistory(specs, opts);
List<Pair<IFileSpec, IFileRevisionData>> ret = new ArrayList<>(res.size());
for (Map.Entry<IFileSpec, List<IFileRevisionData>> entry: res.entrySet()) {
List<IFileRevisionData> value = entry.getValue();
if (value != null && !value.isEmpty()) {
if (LOG.isDebugEnabled()) {
LOG.debug("Mapped " + entry.getKey().getDepotPath() + " to " + entry.getValue());
}
if (entry.getValue().size() != 1) {
throw new IllegalStateException("Unexpected revision count for " + entry.getKey().getDepotPath());
}
ret.add(Pair.create(entry.getKey(), entry.getValue().get(0)));
}
}
return ret;
}