use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdBrowseClient method list.
@Override
public void list(@NotNull SvnTarget target, @Nullable SVNRevision revision, @Nullable Depth depth, @Nullable DirectoryEntryConsumer handler) throws VcsException {
assertUrl(target);
List<String> parameters = new ArrayList<>();
CommandUtil.put(parameters, target);
CommandUtil.put(parameters, revision);
CommandUtil.put(parameters, depth);
parameters.add("--xml");
CommandExecutor command = execute(myVcs, target, SvnCommandName.list, parameters, null);
Info info = myFactory.createInfoClient().doInfo(target, revision);
try {
parseOutput(target.getURL(), command, handler, info != null ? info.getRepositoryRootURL() : null);
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdAnnotateClient method annotate.
@Override
public void annotate(@NotNull SvnTarget target, @NotNull SVNRevision startRevision, @NotNull SVNRevision endRevision, boolean includeMergedRevisions, @Nullable DiffOptions diffOptions, @Nullable final AnnotationConsumer handler) throws VcsException {
List<String> parameters = new ArrayList<>();
CommandUtil.put(parameters, target);
CommandUtil.put(parameters, startRevision, endRevision);
CommandUtil.put(parameters, includeMergedRevisions, "--use-merge-history");
CommandUtil.put(parameters, diffOptions);
parameters.add("--xml");
CommandExecutor command = execute(myVcs, target, SvnCommandName.blame, parameters, null);
parseOutput(command.getOutput(), handler);
}
use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdAddClient method add.
@Override
public void add(@NotNull File file, @Nullable Depth depth, boolean makeParents, boolean includeIgnored, boolean force, @Nullable ProgressTracker handler) throws VcsException {
List<String> parameters = prepareParameters(file, depth, makeParents, includeIgnored, force);
// TODO: handler should be called in parallel with command execution, but this will be in other thread
// TODO: check if that is ok for current handler implementation
// TODO: add possibility to invoke "handler.checkCancelled" - process should be killed
CommandExecutor command = execute(myVcs, SvnTarget.fromFile(file), SvnCommandName.add, parameters, null);
FileStatusResultParser parser = new FileStatusResultParser(CHANGED_PATH, handler, new AddStatusConvertor());
parser.parse(command.getOutput());
}
use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdContentClient method getContent.
@Override
public byte[] getContent(@NotNull SvnTarget target, @Nullable SVNRevision revision, @Nullable SVNRevision pegRevision) throws VcsException, FileTooBigRuntimeException {
// TODO: rewrite this to provide output as Stream
// TODO: Also implement max size constraint like in SvnKitContentClient
// NOTE: Export could not be used to get content of scheduled for deletion file
List<String> parameters = new ArrayList<>();
CommandUtil.put(parameters, target.getPathOrUrlString(), pegRevision);
CommandUtil.put(parameters, revision);
CommandExecutor command = null;
try {
command = execute(myVcs, target, SvnCommandName.cat, parameters, null);
} catch (SvnBindException e) {
// "no pristine version" error is thrown, for instance, for locally replaced files (not committed yet)
if (StringUtil.containsIgnoreCase(e.getMessage(), NO_PRISTINE_VERSION_FOR_FILE)) {
LOG.debug(e);
} else {
throw e;
}
}
byte[] bytes = command != null ? command.getBinaryOutput().toByteArray() : ArrayUtil.EMPTY_BYTE_ARRAY;
ContentRevisionCache.checkContentsSize(target.getPathOrUrlString(), bytes.length);
return bytes;
}
use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdLockClient method lock.
@Override
public void lock(@NotNull File file, boolean force, @NotNull String message, @Nullable ProgressTracker handler) throws VcsException {
List<String> parameters = prepareParameters(file, force);
parameters.add("--message");
parameters.add(message);
CommandExecutor command = execute(myVcs, SvnTarget.fromFile(file), SvnCommandName.lock, parameters, null);
handleCommandCompletion(command, file, EventAction.LOCKED, EventAction.LOCK_FAILED, handler);
}
Aggregations