@NotNull @Override public String getClientname() { String clientName = ref.getClientName(); if (clientName == null) { // TODO message bundle clientName = "<unknown>"; } return clientName; }
public static void createActionState(@NotNull ClientServerRef ref, @NotNull Map<String, Object> data) { data.put("csr:port", ref.getServerName().getFullPort()); data.put("csr:clientname", ref.getClientName()); } }
@NotNull @Override public String getClientname() { return csRef.getClientName(); }
@NotNull @Override public String getClientname() { return csRef.getClientName(); }
private void renderClientServerRef(ClientServerRef value) { append(P4Bundle.getString("connection.tree.client-name-key"), CONNECTION_PROPERTY_KEY_STYLE); append(value.getClientName() == null ? P4Bundle.getString("connection.tree.client-name-null") : value.getClientName(), CONNECTION_PROPERTY_VALUE_STYLE); }
@NotNull public static State getState(@NotNull ClientServerRef ref) { State ret = new State(); ret.serverPort = ref.getServerName().getFullPort(); ret.clientName = ref.getClientName(); return ret; }
@NotNull private static IFileRevisionData createLocalHistoryFor(ClientServerRef ref, String username, @NotNull IExtendedFileSpec depotRev) { return new FileRevisionData( -1, -1, FileAction.EDIT, new Date(), // IntelliJ probably has a better date value in its local history username, depotRev.getFileType(), depotRev.getDesc(), // Should use active Idea changelist name depotRev.getDepotPathString(), ref.getClientName()); } }
@NotNull PrimitiveMap putClientServerRef(@NotNull String key, @Nullable ClientServerRef ref) { if (ref == null) { return this; } return putString(key + "__serverPort", ref.getServerName().getFullPort()) .putString(key + "__clientName", ref.getClientName()); }
ClientServerRef next = iter.next(); if (hasOne) { sb.append(P4Bundle.message("changelist.decorator.default.second.first", next.getClientName())); } else { sb.append(P4Bundle.message("changelist.decorator.default.first.first", next.getClientName())); sb.append(P4Bundle.message("changelist.decorator.default.middle", next.getClientName())); StringBuilder sb = new StringBuilder(); if (hasOne) { sb.append(P4Bundle.message("changelist.decorator.unknowns.second.first", next.getClientName())); } else { sb.append(P4Bundle.message("changelist.decorator.unknowns.first.first", next.getClientName())); sb.append(P4Bundle.message("changelist.decorator.unknowns.middle", next.getClientName())); StringBuilder sb = new StringBuilder(); if (hasOne) { sb.append(P4Bundle.message("changelist.decorator.unsynced.second.first", next.getClientName())); } else { sb.append(P4Bundle.message("changelist.decorator.unsynced.first.first", next.getClientName())); sb.append(P4Bundle.message("changelist.decorator.unsynced.middle", next.getClientName())); StringBuilder sb = new StringBuilder(); if (hasOne) { sb.append(P4Bundle.message("changelist.decorator.offline.second.first", next.getClientName())); } else { sb.append(P4Bundle.message("changelist.decorator.offline.first.first", next.getClientName()));
@NotNull @Override public P4CommandRunner.QueryAnswer<ListFileHistoryResult> listFilesHistory(ServerConfig config, ListFileHistoryQuery query) { final List<IFileSpec> fileSpec = FileSpecBuildUtil.escapedForFilePaths(query.getFile()); return new QueryAnswerImpl<>(connectionManager.withConnection(config, (server) -> new ListFileHistoryResult(config, createFileHistoryList( config, query.getClientServerRef().getClientName(), query.getFile(), cmd.getHistory(server, query.getClientServerRef().getClientName(), fileSpec, query.getMaxResults()))))); }
if (ref.getClientName() == null) { dataOutput.writeUTF(ref.getClientName());
@Nullable public P4LocalChangelist getPendingChangelist(CreateChangelistAction action, boolean create) throws InterruptedException { String actionId = action.getActionId(); // Note: cannot obtain a write lock while within a read lock, so, because the operation // has the chance to perform a write operation, the whole thing must be a write operation. return lockTimeout.withWriteLock(lock, () -> { P4LocalChangelist pending = pendingChangelists.get(actionId); if (pending == null && create) { int next = pendingChangelistIdCounter.decrementAndGet(); pending = new P4LocalChangelistImpl.Builder() .withChangelistId(action.getClientServerRef(), next) .withClientname(action.getClientServerRef().getClientName()) .withComment(action.getComment()) // We don't have this information, but we can't use a null value. // Attempting to store this information won't enrich the UI, so leave // a dummy value. .withUsername("(unknown)") .build(); pendingChangelists.put(actionId, pending); } return pending; }); }
@NotNull @Override public P4CommandRunner.QueryAnswer<ListFilesDetailsResult> listFilesDetails(ServerConfig config, ListFilesDetailsQuery query) { final List<IFileSpec> fileSpecs = FileSpecBuildUtil.escapedForFilePathsAnnotated( query.getFiles(), // TODO replace with more Perforce API way of creating the annotation. query.getRevState() == ListFilesDetailsQuery.RevState.HEAD ? "#head" : "#have", true); return new QueryAnswerImpl<>(connectionManager.withConnection(config, (server) -> new ListFilesDetailsResult(config, cmd.getFilesDetails(server, query.getClientServerRef().getClientName(), fileSpecs).stream() .map((e) -> query.getRevState() == ListFilesDetailsQuery.RevState.HEAD ? P4FileRevisionImpl.getHead(query.getClientServerRef(), e) : P4FileRevisionImpl.getHave(query.getClientServerRef(), e) ) .collect(Collectors.toList())))); }
LOG.debug("Root " + root + ", ref " + root.getClientConfig().getClientServerRef() + " is not the same ref as " + ref); LOG.debug("param ref: clientname: [" + ref.getClientName() + "]; server [" + ref.getServerName().getServerPort() + "]; protocol [" + ref.getServerName().getServerProtocol() + "]"); ClientServerRef rt = root.getClientConfig().getClientServerRef(); LOG.debug("root ref: clientname: [" + rt.getClientName() + "]; server [" + rt.getServerName().getServerPort() + "]; protocol [" + rt.getServerName().getServerProtocol() + "]");