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; }
GetRevisionHistoryOptions opts = new GetRevisionHistoryOptions() .setMaxRevs(maxRevCount) .setContentHistory(false)
GetRevisionHistoryOptions getRevisionHistoryOptions = new GetRevisionHistoryOptions(); Map<IFileSpec, List<IFileRevisionData>> revisionMap = server.getRevisionHistory( fileSpecs, getRevisionHistoryOptions );
GetRevisionHistoryOptions revisionHistoryOptions = new GetRevisionHistoryOptions() .setContentHistory(contentHistory) .setIncludeInherited(includeInherited)
GetRevisionHistoryOptions revisionHistoryOptions = new GetRevisionHistoryOptions() .setContentHistory(contentHistory) .setIncludeInherited(includeInherited)