Search in sources :

Example 6 with SvnTarget

use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.

the class SvnDiffFromHistoryHandler method getChangesBetweenRevisions.

@NotNull
@Override
protected List<Change> getChangesBetweenRevisions(@NotNull FilePath path, @NotNull SvnFileRevision rev1, @Nullable SvnFileRevision rev2) throws VcsException {
    File file = path.getIOFile();
    SvnTarget target1 = SvnTarget.fromURL(SvnUtil.createUrl(rev1.getURL()), rev1.getRevision());
    SvnTarget target2 = rev2 != null ? SvnTarget.fromURL(SvnUtil.createUrl(rev2.getURL()), rev2.getRevision()) : SvnTarget.fromFile(file);
    return executeDiff(path, target1, target2);
}
Also used : SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget) File(java.io.File) NotNull(org.jetbrains.annotations.NotNull)

Example 7 with SvnTarget

use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.

the class SvnDiffFromHistoryHandler method getAffectedChanges.

@NotNull
@Override
protected List<Change> getAffectedChanges(@NotNull FilePath path, @NotNull SvnFileRevision rev) throws VcsException {
    // Diff with zero revision is used here to get just affected changes under the path, and not all affected changes of the revision.
    SvnTarget target1 = SvnTarget.fromURL(SvnUtil.createUrl(rev.getURL()), SVNRevision.create(0));
    SvnTarget target2 = SvnTarget.fromURL(SvnUtil.createUrl(rev.getURL()), rev.getRevision());
    return executeDiff(path, target1, target2);
}
Also used : SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget) NotNull(org.jetbrains.annotations.NotNull)

Example 8 with SvnTarget

use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.

the class SingleCommittedListProvider method searchFromHead.

// return changed path, if any
private FilePath searchFromHead(@NotNull SVNURL url) throws VcsException {
    final SvnCopyPathTracker pathTracker = new SvnCopyPathTracker(repositoryUrl.toDecodedString(), repositoryRelativeUrl);
    SvnTarget target = SvnTarget.fromURL(url);
    myVcs.getFactory(target).createHistoryClient().doLog(target, SVNRevision.HEAD, revisionBefore, false, true, false, 0, null, logEntry -> {
        checkDisposed();
        if (logEntry.getDate() != null) {
            pathTracker.accept(logEntry);
            if (logEntry.getRevision() == revisionBefore.getNumber()) {
                changeList[0] = createChangeList(logEntry);
            }
        }
    });
    FilePath path = pathTracker.getFilePath(myVcs);
    return path == null ? filePath : path;
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget)

Example 9 with SvnTarget

use of org.tmatesoft.svn.core.wc2.SvnTarget 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 10 with SvnTarget

use of org.tmatesoft.svn.core.wc2.SvnTarget in project intellij-community by JetBrains.

the class FirstInBranch method run.

@Nullable
public CopyData run() throws VcsException {
    SvnTarget trunk = SvnTarget.fromURL(createUrl(myAbsoluteTrunkUrl), SVNRevision.HEAD);
    SvnTarget branch = SvnTarget.fromURL(createUrl(myAbsoluteBranchUrl), SVNRevision.HEAD);
    CopyData result = find(new BranchPoint(trunk), new BranchPoint(branch), true);
    debug(result);
    return result;
}
Also used : SvnTarget(org.tmatesoft.svn.core.wc2.SvnTarget) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

SvnTarget (org.tmatesoft.svn.core.wc2.SvnTarget)29 NotNull (org.jetbrains.annotations.NotNull)15 File (java.io.File)10 SVNURL (org.tmatesoft.svn.core.SVNURL)10 VcsException (com.intellij.openapi.vcs.VcsException)7 SVNRevision (org.tmatesoft.svn.core.wc.SVNRevision)7 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)6 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 SvnVcs (org.jetbrains.idea.svn.SvnVcs)5 Logger (com.intellij.openapi.diagnostic.Logger)4 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)4 Pair (com.intellij.openapi.util.Pair)4 Ref (com.intellij.openapi.util.Ref)4 FilePath (com.intellij.openapi.vcs.FilePath)4 Nullable (org.jetbrains.annotations.Nullable)4 SVNException (org.tmatesoft.svn.core.SVNException)4 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)3 FileUtil (com.intellij.openapi.util.io.FileUtil)3 Registry (com.intellij.openapi.util.registry.Registry)3 VcsRevisionNumber (com.intellij.openapi.vcs.history.VcsRevisionNumber)3