/** * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) */ public List<String> processOptions(IServer server) throws OptionsException { this.optionList = this.processFields(OPTIONS_SPECS, this.getChangelistId(), this.getMaxRevs(), this.isContentHistory(), this.isIncludeInherited(), this.isLongOutput(), this.isTruncatedLongOutput(), this.isOmitNonContributaryIntegrations()); return this.optionList; }
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 getRevisionHistoryOptions = new GetRevisionHistoryOptions(); Map<IFileSpec, List<IFileRevisionData>> revisionMap = server.getRevisionHistory( fileSpecs, getRevisionHistoryOptions );
GetRevisionHistoryOptions revisionHistoryOptions = new GetRevisionHistoryOptions() .setContentHistory(contentHistory) .setIncludeInherited(includeInherited) .setLongOutput(longOutput) .setTruncatedLongOutput(truncatedLongOutput) .setMaxRevs(maxRevs); return getRevisionHistory(fileSpecs, revisionHistoryOptions); } catch (final ConnectionException | AccessException exc) {
GetRevisionHistoryOptions revisionHistoryOptions = new GetRevisionHistoryOptions() .setContentHistory(contentHistory) .setIncludeInherited(includeInherited) .setLongOutput(longOutput) .setTruncatedLongOutput(truncatedLongOutput) .setMaxRevs(maxRevs); return getRevisionHistory(fileSpecs, revisionHistoryOptions); } catch (final ConnectionException | AccessException exc) {
/** * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) */ public List<String> processOptions(IServer server) throws OptionsException { this.optionList = this.processFields(OPTIONS_SPECS, this.getChangelistId(), this.getMaxRevs(), this.isContentHistory(), this.isIncludeInherited(), this.isLongOutput(), this.isTruncatedLongOutput(), this.isOmitNonContributaryIntegrations()); return this.optionList; }
GetRevisionHistoryOptions opts = new GetRevisionHistoryOptions() .setMaxRevs(maxRevCount) .setContentHistory(false) .setIncludeInherited(true) .setLongOutput(true) .setTruncatedLongOutput(false); Map<IFileSpec, List<IFileRevisionData>> res = server.getRevisionHistory(singleSpec, opts); List<IFileRevisionData> ret = new ArrayList<>();