diff options
Diffstat (limited to 'plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java')
-rw-r--r-- | plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java index ba0288da9699..a51ce8c13629 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchesLoader.java @@ -21,13 +21,13 @@ import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; -import org.jetbrains.idea.svn.SvnConfiguration; import org.jetbrains.idea.svn.SvnVcs; import org.jetbrains.idea.svn.api.Depth; +import org.jetbrains.idea.svn.browse.BrowseClient; import org.jetbrains.idea.svn.browse.DirectoryEntry; import org.jetbrains.idea.svn.browse.DirectoryEntryConsumer; -import org.tmatesoft.svn.core.*; -import org.tmatesoft.svn.core.wc.SVNLogClient; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc2.SvnTarget; @@ -75,23 +75,13 @@ public class BranchesLoader implements Runnable { @NotNull public List<SvnBranchItem> loadBranches() throws SVNException, VcsException { - final SvnConfiguration configuration = SvnConfiguration.getInstance(myProject); - final SvnVcs vcs = SvnVcs.getInstance(myProject); + SvnVcs vcs = SvnVcs.getInstance(myProject); SVNURL branchesUrl = SVNURL.parseURIEncoded(myUrl); List<SvnBranchItem> result = new LinkedList<SvnBranchItem>(); SvnTarget target = SvnTarget.fromURL(branchesUrl); + DirectoryEntryConsumer handler = createConsumer(result); - if (!myPassive) { - // TODO: Implement ability to specify interactive/non-interactive auth mode for clients - DirectoryEntryConsumer handler = createConsumer(branchesUrl, result); - vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, handler); - } - else { - ISVNDirEntryHandler handler = createHandler(branchesUrl, result); - SVNLogClient client = vcs.getSvnKitManager().createLogClient(configuration.getPassiveAuthenticationManager(myProject)); - client - .doList(target.getURL(), target.getPegRevision(), SVNRevision.HEAD, false, SVNDepth.IMMEDIATES, SVNDirEntry.DIRENT_ALL, handler); - } + vcs.getFactory(target).create(BrowseClient.class, !myPassive).list(target, SVNRevision.HEAD, Depth.IMMEDIATES, handler); Collections.sort(result); return result; @@ -105,25 +95,12 @@ public class BranchesLoader implements Runnable { } @NotNull - private static ISVNDirEntryHandler createHandler(@NotNull final SVNURL branchesUrl, @NotNull final List<SvnBranchItem> result) { - return new ISVNDirEntryHandler() { - public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException { - // TODO: Remove equality check with branchesUrl when SVNLogClient will not be used directly, but rather through BrowseClient. - if (!branchesUrl.equals(dirEntry.getURL()) && dirEntry.getDate() != null) { - result.add(new SvnBranchItem(dirEntry.getURL().toDecodedString(), dirEntry.getDate(), dirEntry.getRevision())); - } - } - }; - } - - @NotNull - private static DirectoryEntryConsumer createConsumer(@NotNull final SVNURL branchesUrl, @NotNull final List<SvnBranchItem> result) { + private static DirectoryEntryConsumer createConsumer(@NotNull final List<SvnBranchItem> result) { return new DirectoryEntryConsumer() { @Override public void consume(final DirectoryEntry entry) throws SVNException { - // TODO: Remove equality check with branchesUrl when SVNLogClient will not be used directly, but rather through BrowseClient. - if (!branchesUrl.equals(entry.getUrl()) && entry.getDate() != null) { + if (entry.getDate() != null) { result.add(new SvnBranchItem(entry.getUrl().toDecodedString(), entry.getDate(), entry.getRevision())); } } |