use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdLockClient method unlock.
@Override
public void unlock(@NotNull File file, boolean force, @Nullable ProgressTracker handler) throws VcsException {
List<String> parameters = prepareParameters(file, force);
CommandExecutor command = execute(myVcs, SvnTarget.fromFile(file), SvnCommandName.unlock, parameters, null);
handleCommandCompletion(command, file, EventAction.UNLOCKED, EventAction.UNLOCK_FAILED, handler);
}
use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdRevertClient method revert.
@Override
public void revert(@NotNull Collection<File> paths, @Nullable Depth depth, @Nullable ProgressTracker handler) throws VcsException {
if (!ContainerUtil.isEmpty(paths)) {
Command command = newCommand(SvnCommandName.revert);
command.put(depth);
command.setTargets(paths);
// 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
SvnTarget target = SvnTarget.fromFile(ObjectUtils.assertNotNull(ContainerUtil.getFirstItem(paths)));
CommandExecutor executor = execute(myVcs, target, CommandUtil.getHomeDirectory(), command, null);
FileStatusResultParser parser = new FileStatusResultParser(CHANGED_PATH, handler, new RevertStatusConvertor());
parser.parse(executor.getOutput());
}
}
use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdHistoryClient method doLog.
@Override
public void doLog(@NotNull SvnTarget target, @NotNull SVNRevision startRevision, @NotNull SVNRevision endRevision, boolean stopOnCopy, boolean discoverChangedPaths, boolean includeMergedRevisions, long limit, @Nullable String[] revisionProperties, @Nullable LogEntryConsumer handler) throws VcsException {
// TODO: add revision properties parameter if necessary
List<String> parameters = prepareCommand(target, startRevision, endRevision, stopOnCopy, discoverChangedPaths, includeMergedRevisions, limit);
try {
CommandExecutor command = execute(myVcs, target, SvnCommandName.log, parameters, null);
// 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
parseOutput(command, handler);
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdDiffClient method compare.
@NotNull
@Override
public List<Change> compare(@NotNull SvnTarget target1, @NotNull SvnTarget target2) throws VcsException {
assertUrl(target1);
if (target2.isFile()) {
// Such combination (file and url) with "--summarize" option is supported only in svn 1.8.
// For svn 1.7 "--summarize" is only supported when both targets are repository urls.
assertDirectory(target2);
WorkingCopyFormat format = WorkingCopyFormat.from(myFactory.createVersionClient().getVersion());
if (format.less(WorkingCopyFormat.ONE_DOT_EIGHT)) {
throw new SvnBindException("Could not compare local file and remote url with executable for svn " + format);
}
}
List<String> parameters = new ArrayList<>();
CommandUtil.put(parameters, target1);
CommandUtil.put(parameters, target2);
parameters.add("--xml");
parameters.add("--summarize");
CommandExecutor executor = execute(myVcs, target1, SvnCommandName.diff, parameters, null);
return parseOutput(target1, target2, executor);
}
use of org.jetbrains.idea.svn.commandLine.CommandExecutor in project intellij-community by JetBrains.
the class CmdDiffClient method unifiedDiff.
@Override
public void unifiedDiff(@NotNull SvnTarget target1, @NotNull SvnTarget target2, @NotNull OutputStream output) throws VcsException {
assertUrl(target1);
assertUrl(target2);
List<String> parameters = ContainerUtil.newArrayList();
CommandUtil.put(parameters, target1);
CommandUtil.put(parameters, target2);
CommandExecutor executor = execute(myVcs, target1, SvnCommandName.diff, parameters, null);
try {
executor.getBinaryOutput().writeTo(output);
} catch (IOException e) {
throw new SvnBindException(e);
}
}
Aggregations