Search in sources :

Example 11 with SvnBindException

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

the class ElementWithBranchComparer method run.

public void run() {
    new Task.Modal(myProject, getTitle(), true) {

        @Override
        public void run(@NotNull ProgressIndicator indicator) {
            try {
                beforeCompare();
                myElementUrl = resolveElementUrl();
                if (myElementUrl == null) {
                    reportNotFound();
                } else {
                    compare();
                }
            } catch (SVNCancelException ex) {
                ElementWithBranchComparer.this.onCancel();
            } catch (SVNException ex) {
                reportException(new SvnBindException(ex));
            } catch (SvnBindException ex) {
                reportException(ex);
            } catch (VcsException ex) {
                reportGeneralException(ex);
            }
        }
    }.queue();
    showResult();
}
Also used : Task(com.intellij.openapi.progress.Task) SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) SVNCancelException(org.tmatesoft.svn.core.SVNCancelException) VcsException(com.intellij.openapi.vcs.VcsException) SVNException(org.tmatesoft.svn.core.SVNException)

Example 12 with SvnBindException

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

the class SvnUpdateRootOptionsPanel method apply.

public void apply(final SvnConfiguration configuration) throws ConfigurationException {
    final UpdateRootInfo rootInfo = configuration.getUpdateRootInfo(myRoot.getIOFile(), myVcs);
    if (myUpdateToSpecificUrl.isSelected()) {
        try {
            rootInfo.setUrl(SvnUtil.createUrl(myURLText.getText(), false));
        } catch (SvnBindException e) {
            throw new ConfigurationException("Invalid url: " + myURLText.getText());
        }
    }
    rootInfo.setUpdateToRevision(myRevisionBox.isSelected());
    final SVNRevision revision = SVNRevision.parse(myRevisionText.getText());
    if (!revision.isValid()) {
        throw new ConfigurationException(SvnBundle.message("invalid.svn.revision.error.message", myRevisionText.getText()));
    }
    rootInfo.setRevision(revision);
}
Also used : SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) ConfigurationException(com.intellij.openapi.options.ConfigurationException) SVNRevision(org.tmatesoft.svn.core.wc.SVNRevision)

Example 13 with SvnBindException

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

the class SingleCommittedListProvider method searchForUrl.

private boolean searchForUrl(@NotNull SVNURL url) throws VcsException {
    LogEntryConsumer handler = logEntry -> {
        checkDisposed();
        if (logEntry.getDate() != null) {
            changeList[0] = createChangeList(logEntry);
        }
    };
    SvnTarget target = SvnTarget.fromURL(url);
    try {
        myVcs.getFactory(target).createHistoryClient().doLog(target, revisionBefore, revisionBefore, false, true, false, 1, null, handler);
    } catch (SvnBindException e) {
        LOG.info(e);
        if (!e.containsCategory(SVNErrorCode.FS_CATEGORY)) {
            throw e;
        }
    }
    return changeList[0] != null;
}
Also used : SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) VcsRevisionNumber(com.intellij.openapi.vcs.history.VcsRevisionNumber) VcsUtil(com.intellij.vcsUtil.VcsUtil) RootUrlInfo(org.jetbrains.idea.svn.RootUrlInfo) SvnRevisionNumber(org.jetbrains.idea.svn.SvnRevisionNumber) Change(com.intellij.openapi.vcs.changes.Change) VirtualFile(com.intellij.openapi.vfs.VirtualFile) ContentRevision(com.intellij.openapi.vcs.changes.ContentRevision) SVNErrorCode(org.tmatesoft.svn.core.SVNErrorCode) SvnAuthenticationNotifier(org.jetbrains.idea.svn.auth.SvnAuthenticationNotifier) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) SvnUtil(org.jetbrains.idea.svn.SvnUtil) SVNRevision(org.tmatesoft.svn.core.wc.SVNRevision) SVNURL(org.tmatesoft.svn.core.SVNURL) Pair(com.intellij.openapi.util.Pair) Project(com.intellij.openapi.project.Project) SvnVcs(org.jetbrains.idea.svn.SvnVcs) Logger(com.intellij.openapi.diagnostic.Logger) VcsException(com.intellij.openapi.vcs.VcsException) NotNull(org.jetbrains.annotations.NotNull) SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget) FilePath(com.intellij.openapi.vcs.FilePath) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget)

Example 14 with SvnBindException

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

the class SvnUtil method getBranchForUrl.

@Nullable
public static SVNURL getBranchForUrl(@NotNull SvnVcs vcs, @NotNull VirtualFile vcsRoot, @NotNull SVNURL url) {
    SVNURL result = null;
    SvnBranchConfigurationNew configuration = SvnBranchConfigurationManager.getInstance(vcs.getProject()).get(vcsRoot);
    try {
        result = configuration.getWorkingBranch(url);
    } catch (SvnBindException e) {
        LOG.debug(e);
    }
    return result;
}
Also used : SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SVNURL(org.tmatesoft.svn.core.SVNURL) SvnBranchConfigurationNew(org.jetbrains.idea.svn.branchConfig.SvnBranchConfigurationNew) Nullable(org.jetbrains.annotations.Nullable)

Example 15 with SvnBindException

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

the class CmdVersionClient method parseVersion.

@NotNull
public static Version parseVersion(@NotNull String versionText) throws SvnBindException {
    Version result = null;
    Exception cause = null;
    Matcher matcher = VERSION.matcher(versionText);
    boolean found = matcher.find();
    if (found) {
        try {
            result = new Version(getInt(matcher.group(1)), getInt(matcher.group(2)), getInt(matcher.group(3)));
        } catch (NumberFormatException e) {
            cause = e;
        }
    }
    if (!found || cause != null) {
        throw new SvnBindException(String.format("Could not parse svn version: %s", versionText), cause);
    }
    return result;
}
Also used : SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) Version(com.intellij.openapi.util.Version) Matcher(java.util.regex.Matcher) SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) NotNull(org.jetbrains.annotations.NotNull)

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