public ShelveFilesAction(P4ChangelistId changelistId, List<FilePath> files) { this(createActionId(ShelveFilesAction.class), changelistId, files); }
@NotNull @Override public String[] getDisplayParameters() { if (changelistId != null) { return new String[] { changeId(changelistId) }; } return EMPTY; }
case ADD_EDIT_FILE: { AddEditAction fileAction = (AddEditAction) action; return performFileAction(config, action, fileAction.getFile(), fileAction.getFileType(), P4FileAction.ADD_EDIT); return performFileAction(config, action, fileAction.getFile(), null, P4FileAction.DELETE); return performFileAction(config, action, fileAction.getFile(), null, P4FileAction.REVERTED);
public P4AnnotatedFileImpl(@NotNull Project project, @Nullable String clientname, @NotNull FilePath file, @Nullable HistoryMessageFormatter formatter, @Nullable HistoryContentLoader loader, @NotNull AnnotateFileResult annotatedFileResult) { super(project); this.clientname = clientname; this.file = file; this.config = annotatedFileResult.getServerConfig(); this.annotatedFile = annotatedFileResult.getAnnotatedFile(); this.head = annotatedFileResult.getHeadRevision(); this.content = annotatedFileResult.getContent(); this.formatter = formatter; this.loader = loader; }
@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()))))); }
private ShelveFilesResult shelveFiles(IClient client, ClientConfig config, ShelveFilesAction action) throws P4JavaException { if (action.getFiles().isEmpty()) { throw new IllegalArgumentException("must provide at least one file to shelve"); } if (LOG.isDebugEnabled()) { LOG.debug("Shelving files for " + action.getChangelistId() + " / " + action.getFiles()); } List<IFileSpec> specs = FileSpecBuildUtil.forFilePaths(action.getFiles()); List<IFileSpec> res = cmd.shelveFiles(client, specs, action.getChangelistId().getChangelistId()); MessageStatusUtil.throwIfError(res); LOG.info("Server returned " + res); return new ShelveFilesResult(config, action.getChangelistId(), action.getFiles()); }
@Nullable @Override public byte[] loadContentForLocal(@NotNull ServerConfig config, @NotNull String clientname, @NotNull FilePath localFile, int rev) throws VcsException { return loadContent(config, new GetFileContentsQuery(localFile, clientname, rev)) .getData(); }
@NotNull @Override public String[] getDisplayParameters() { if (isRevertOnlyIfUnchanged()) { // TODO message catalog // TODO make this static return new String[] { "unchanged" }; } return EMPTY; }
@Nullable @Override public String loadStringContentForLocal(@NotNull ServerConfig config, @NotNull String clientname, @NotNull FilePath localFile, int rev) throws IOException, VcsException { return loadContent(config, new GetFileContentsQuery(localFile, clientname, rev)) .getStringData(); }
@NotNull @Override public String[] getDisplayParameters() { return new String[] { changeId(changelistId) }; }
@NotNull @Override public String[] getDisplayParameters() { if (changelistId != null) { return new String[] { changeId(changelistId) }; } return EMPTY; }
@NotNull @Override public String[] getDisplayParameters() { if (changelistId != null) { return new String[] { changeId(changelistId) }; } return EMPTY; }
public DeleteFileAction(@NotNull FilePath file, P4ChangelistId changelistId) { this(createActionId(DeleteFileAction.class), file, changelistId); }
public RevertFileAction(@NotNull FilePath file, boolean ifUnchanged) { this(createActionId(RevertFileAction.class), file, ifUnchanged); }
public List<VcsFileRevision> getRevisions(@Nullable HistoryMessageFormatter formatter, @Nullable HistoryContentLoader loader) { return factory.create(formatter, loader); }
public MoveFileAction(@NotNull FilePath source, @NotNull FilePath target, P4ChangelistId changelistId) { this(createActionId(MoveFileAction.class), source, target, changelistId); }
public AddEditAction(@NotNull FilePath file, @Nullable P4FileType type, @NotNull P4ChangelistId changelistId, @Nullable String charset) { this(createActionId(AddEditAction.class), file, type, changelistId, charset); }
public File getExecDir(P4CommandRunner.ClientAction<?> action) { return ((MoveFileAction) action).getTargetFile().getIOFile().getParentFile(); }
@Nullable @Override public byte[] loadContentForRev(@NotNull ServerConfig config, @NotNull String clientname, @NotNull String depotPath, int rev) throws VcsException { return loadContent(config, new GetFileContentsQuery(getDepotPathForRev(depotPath, rev), clientname)) .getData(); }