@NotNull public static <R extends P4CommandRunner.ServerResult> P4CommandRunner.ActionAnswer<R> perform(@NotNull Project project, @NotNull ServerConfig config, @NotNull P4CommandRunner.ServerAction<R> action) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); P4CommandRunner.ActionAnswer<R> ret = instance.first.getCommandRunner().perform(config, action); if (instance.second) { ret.whenAnyState(instance.first::dispose); } return ret; }
@NotNull public static <R extends P4CommandRunner.ServerNameResult> P4CommandRunner.QueryAnswer<R> query(@NotNull Project project, @NotNull P4ServerName name, @NotNull P4CommandRunner.ServerNameQuery<R> query) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); P4CommandRunner.QueryAnswer<R> ret = instance.first.getCommandRunner().query(name, query); if (instance.second) { ret.whenAnyState(instance.first::dispose); } return ret; }
public static P4CommandRunner.ActionAnswer<Void> sendCachedPendingRequests( @NotNull Project project, @NotNull ClientConfig clientConfig) { P4ServerComponent ret = project.getComponent(P4ServerComponent.class); if (ret == null || ret.getCommandRunner() == null) { return new DoneActionAnswer<>(null); } return ret.getCommandRunner().sendCachedPendingRequests(clientConfig); }
@NotNull public static <R extends P4CommandRunner.ServerResult> P4CommandRunner.FutureResult<R> syncQuery(@NotNull Project project, @NotNull ServerConfig config, @NotNull P4CommandRunner.SyncServerQuery<R> query) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); P4CommandRunner.FutureResult<R> ret = instance.first.getCommandRunner().syncQuery(config, query); if (instance.second) { ret.getPromise().whenAnyState(instance.first::dispose); } return ret; }
@NotNull public static <R extends P4CommandRunner.ServerResult> R syncCachedQuery(@NotNull Project project, @NotNull ServerConfig config, @NotNull P4CommandRunner.SyncServerQuery<R> query) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); R ret = instance.first.getCommandRunner().syncCachedQuery(config, query); if (instance.second) { instance.first.dispose(); } return ret; }
@NotNull public static <R extends P4CommandRunner.ClientResult> P4CommandRunner.FutureResult<R> syncQuery(@NotNull Project project, @NotNull ClientConfig config, @NotNull P4CommandRunner.SyncClientQuery<R> query) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); P4CommandRunner.FutureResult<R> ret = instance.first.getCommandRunner().syncQuery(config, query); if (instance.second) { ret.getPromise().whenAnyState(instance.first::dispose); } return ret; }
@NotNull public static <R extends P4CommandRunner.ClientResult> R syncCachedQuery(@NotNull Project project, @NotNull ClientConfig config, @NotNull P4CommandRunner.SyncClientQuery<R> query) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); R ret = instance.first.getCommandRunner().syncCachedQuery(config, query); if (instance.second) { instance.first.dispose(); } return ret; }
@NotNull public static <R extends P4CommandRunner.ClientResult> P4CommandRunner.ActionAnswer<R> perform(@NotNull Project project, @NotNull ClientConfig config, @NotNull P4CommandRunner.ClientAction<R> action) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); P4CommandRunner.ActionAnswer<R> ret = instance.first.getCommandRunner().perform(config, action); if (instance.second) { ret.whenAnyState(instance.first::dispose); } return ret; }
@NotNull public static <R extends P4CommandRunner.ServerResult> P4CommandRunner.QueryAnswer<R> query(@NotNull Project project, @NotNull ServerConfig config, @NotNull P4CommandRunner.ServerQuery<R> query) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); P4CommandRunner.QueryAnswer<R> ret = instance.first.getCommandRunner().query(config, query); if (instance.second) { ret.whenAnyState(instance.first::dispose); } return ret; }
.perform(root.getClientConfig(), new AddEditAction(addedFile, null, defaultChangeId, (String) null)); assertSize(0, errors); assertSize(1, vcs.cacheComponent.getState().pendingActions);
@NotNull public static <R extends P4CommandRunner.ClientResult> P4CommandRunner.QueryAnswer<R> query(@NotNull Project project, @NotNull ClientConfig config, @NotNull P4CommandRunner.ClientQuery<R> query) { final Pair<P4ServerComponent, Boolean> instance = findInstance(project); P4CommandRunner.QueryAnswer<R> ret = instance.first.getCommandRunner().query(config, query); if (instance.second) { ret.whenAnyState(instance.first::dispose); } return ret; }
.perform(root.getClientConfig(), new AddEditAction(addedFile, null, newP4Change, "UTF-8")); assertSize(0, errors); assertSize(1, vcs.cacheComponent.getState().pendingActions);
.perform(root.getClientConfig(), new AddEditAction(addedFile, null, defaultChangeId, (String) null)); errors.assertEmpty(); assertSize(1, vcs.cacheComponent.getState().pendingActions);