Search in sources :

Example 16 with SvnBindException

use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.

the class SvnFileSystemListener method for17move.

private boolean for17move(final SvnVcs vcs, final File src, final File dst, boolean undo, Status srcStatus) throws VcsException {
    if (srcStatus != null && srcStatus.getCopyFromURL() == null) {
        undo = false;
    }
    if (undo) {
        myUndoingMove = true;
        createRevertAction(vcs, dst, true).execute();
        copyUnversionedMembersOfDirectory(src, dst);
        if (isUnversioned(srcStatus)) {
            FileUtil.delete(src);
        } else {
            createRevertAction(vcs, src, true).execute();
        }
        restoreFromUndoStorage(dst);
    } else {
        if (doUsualMove(vcs, src))
            return true;
        // check destination directory
        if (isUnversioned(vcs, dst.getParentFile())) {
            try {
                FileUtil.copyFileOrDir(src, dst);
            } catch (IOException e) {
                throw new SvnBindException(e);
            }
            createDeleteAction(vcs, src, true).execute();
            return false;
        }
        moveFileWithSvn(vcs, src, dst);
    }
    return false;
}
Also used : SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) IOException(java.io.IOException)

Example 17 with SvnBindException

use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.

the class MarkResolvedAction method collectResolvablePaths.

@NotNull
private static Collection<String> collectResolvablePaths(@NotNull SvnVcs vcs, @NotNull VirtualFile[] files) {
    Collection<String> result = newTreeSet();
    for (VirtualFile file : files) {
        try {
            File path = VfsUtilCore.virtualToIoFile(file);
            StatusClient client = vcs.getFactory(path).createStatusClient();
            client.doStatus(path, SVNRevision.UNDEFINED, Depth.INFINITY, false, false, false, false, status -> {
                if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED || status.getPropertiesStatus() == StatusType.STATUS_CONFLICTED) {
                    result.add(status.getFile().getAbsolutePath());
                }
            }, null);
        } catch (SvnBindException e) {
            LOG.warn(e);
        }
    }
    return result;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) StatusClient(org.jetbrains.idea.svn.status.StatusClient) SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) NotNull(org.jetbrains.annotations.NotNull)

Example 18 with SvnBindException

use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.

the class SvnKitUpgradeClient method upgrade.

@Override
public void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException {
    validateFormat(format, getSupportedFormats());
    SVNWCClient client = myVcs.getSvnKitManager().createUpgradeClient();
    client.setEventHandler(toEventHandler(handler));
    try {
        cleanupIfNecessary(path, format, client, handler);
        upgrade(path, format, client, handler);
    } catch (SVNException e) {
        throw new SvnBindException(e);
    }
}
Also used : SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SVNWCClient(org.tmatesoft.svn.core.wc.SVNWCClient) SVNException(org.tmatesoft.svn.core.SVNException)

Example 19 with SvnBindException

use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.

the class SelectLocationDialog method openDialog.

@Nullable
private static SelectLocationDialog openDialog(Project project, String url, String dstLabel, String dstName, boolean showFiles, boolean allowActions, String errorMessage) {
    try {
        SVNURL svnUrl = SvnUtil.createUrl(url);
        final SVNURL repositoryUrl = initRoot(project, svnUrl);
        if (repositoryUrl == null) {
            Messages.showErrorDialog(project, "Can not detect repository root for URL: " + url, SvnBundle.message("dialog.title.select.repository.location"));
            return null;
        }
        SelectLocationDialog dialog = new SelectLocationDialog(project, repositoryUrl, dstLabel, dstName, showFiles, allowActions);
        dialog.show();
        return dialog;
    } catch (SvnBindException e) {
        Messages.showErrorDialog(project, errorMessage != null ? errorMessage : e.getMessage(), SvnBundle.message("dialog.title.select.repository.location"));
        return null;
    }
}
Also used : SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SVNURL(org.tmatesoft.svn.core.SVNURL) Nullable(org.jetbrains.annotations.Nullable)

Example 20 with SvnBindException

use of org.jetbrains.idea.svn.commandLine.SvnBindException in project intellij-community by JetBrains.

the class SvnKitDiffClient method unifiedDiff.

@Override
public void unifiedDiff(@NotNull SvnTarget target1, @NotNull SvnTarget target2, @NotNull OutputStream output) throws VcsException {
    assertUrl(target1);
    assertUrl(target2);
    try {
        myVcs.getSvnKitManager().createDiffClient().doDiff(target1.getURL(), target1.getPegRevision(), target2.getURL(), target2.getPegRevision(), true, false, output);
    } catch (SVNException e) {
        throw new SvnBindException(e);
    }
}
Also used : SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException)

Aggregations

SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)32 SVNException (org.tmatesoft.svn.core.SVNException)13 NotNull (org.jetbrains.annotations.NotNull)7 VirtualFile (com.intellij.openapi.vfs.VirtualFile)6 File (java.io.File)6 CommandExecutor (org.jetbrains.idea.svn.commandLine.CommandExecutor)5 SVNURL (org.tmatesoft.svn.core.SVNURL)5 FilePath (com.intellij.openapi.vcs.FilePath)4 VcsException (com.intellij.openapi.vcs.VcsException)4 VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)4 IOException (java.io.IOException)4 SVNRevision (org.tmatesoft.svn.core.wc.SVNRevision)4 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)3 Change (com.intellij.openapi.vcs.changes.Change)3 ContentRevision (com.intellij.openapi.vcs.changes.ContentRevision)3 ArrayList (java.util.ArrayList)3 ConfigurationException (com.intellij.openapi.options.ConfigurationException)2 Ref (com.intellij.openapi.util.Ref)2 FileStatus (com.intellij.openapi.vcs.FileStatus)2 Nullable (org.jetbrains.annotations.Nullable)2