Search in sources :

Example 1 with Command

use of org.jetbrains.idea.svn.commandLine.Command 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());
    }
}
Also used : Command(org.jetbrains.idea.svn.commandLine.Command) SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget) CommandExecutor(org.jetbrains.idea.svn.commandLine.CommandExecutor)

Aggregations

Command (org.jetbrains.idea.svn.commandLine.Command)1 CommandExecutor (org.jetbrains.idea.svn.commandLine.CommandExecutor)1 SvnTarget (org.tmatesoft.svn.core.wc2.SvnTarget)1