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()) { // it can return empty values for a server message 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; }
.setIncludeInherited(true) .setLongOutput(true) .setTruncatedLongOutput(false); Map<IFileSpec, List<IFileRevisionData>> res = server.getRevisionHistory(singleSpec, opts); List<IFileRevisionData> ret = new ArrayList<>();
.setIncludeInherited(includeInherited) .setLongOutput(longOutput) .setTruncatedLongOutput(truncatedLongOutput) .setMaxRevs(maxRevs); return getRevisionHistory(fileSpecs, revisionHistoryOptions);
.setIncludeInherited(includeInherited) .setLongOutput(longOutput) .setTruncatedLongOutput(truncatedLongOutput) .setMaxRevs(maxRevs); return getRevisionHistory(fileSpecs, revisionHistoryOptions);