From 7e30a36e47cdb0cd5b0761a87fcb17ecfd1ed2c6 Mon Sep 17 00:00:00 2001 From: Irina Chernushina Date: Wed, 14 May 2008 20:20:14 +0400 Subject: [PATCH] SVN: committed/incoming changes details upload rolled back (temporal) --- .../jetbrains/idea/svn/history/SvnChangeList.java | 90 +--------------------- 1 file changed, 4 insertions(+), 86 deletions(-) diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnChangeList.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnChangeList.java index b66c284437..dbc641ce03 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnChangeList.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnChangeList.java @@ -39,10 +39,10 @@ import org.jetbrains.idea.svn.SvnBranchConfiguration; import org.jetbrains.idea.svn.SvnBranchConfigurationManager; import org.jetbrains.idea.svn.SvnUtil; import org.jetbrains.idea.svn.SvnVcs; -import org.tmatesoft.svn.core.*; -import org.tmatesoft.svn.core.io.SVNRepository; -import org.tmatesoft.svn.core.wc.SVNLogClient; -import org.tmatesoft.svn.core.wc.SVNRevision; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.SVNLogEntry; +import org.tmatesoft.svn.core.SVNLogEntryPath; +import org.tmatesoft.svn.core.SVNURL; import java.io.DataInput; import java.io.DataOutput; @@ -63,19 +63,15 @@ public class SvnChangeList implements CommittedChangeList { private Set myChangedPaths = new HashSet(); private Set myAddedPaths = new HashSet(); private Set myDeletedPaths = new HashSet(); - private Map myDirectories; private List myChanges; private File myWcRoot; private SVNURL myBranchUrl; private boolean myBranchInfoLoaded; - private SVNRepository myRepository; - public SvnChangeList(SvnVcs vcs, @NotNull final SvnRepositoryLocation location, final SVNLogEntry logEntry, String repositoryRoot) { myVcs = vcs; myLocation = location; - myDirectories = new HashMap(); myRevision = logEntry.getRevision(); final String author = logEntry.getAuthor(); myAuthor = author == null ? "" : author; @@ -84,99 +80,31 @@ public class SvnChangeList implements CommittedChangeList { myMessage = message == null ? "" : message; myRepositoryRoot = repositoryRoot; - initRepository(); - final Map> deletedChildren = new HashMap>(); - final Map copiedAdded = new HashMap(); for(Object o: logEntry.getChangedPaths().values()) { final SVNLogEntryPath entry = (SVNLogEntryPath) o; final String path = entry.getPath(); if (entry.getType() == 'A') { myAddedPaths.add(path); - if (entry.getCopyPath() != null) { - copiedAdded.put(entry.getCopyPath(), path); - } } else if (entry.getType() == 'D') { myDeletedPaths.add(path); - final Collection deleted = getChildren(path, myRevision - 1); - if (deleted != null) { - for (String name : deleted) { - myDeletedPaths.add(path + '/' + name); - } - deletedChildren.put(path, deleted); - } } else { myChangedPaths.add(path); } } - - // look for renamed folders contents - for (Map.Entry entry : copiedAdded.entrySet()) { - final Collection contents = deletedChildren.get(entry.getKey()); - if (contents != null) { - for (String name : contents) { - final String path = entry.getValue() + '/' + name; - myAddedPaths.add(path); - myDirectories.put(path, Boolean.TRUE); - } - } - } updateBranchInfo(); } - @Nullable - private Collection getChildren(final String path, final long revision) { - if (myRepository == null) { - return null; - } - - try { - final boolean isDir = SVNNodeKind.DIR.equals(myRepository.checkPath(path, revision)); - myDirectories.put(path, isDir); - - if (! isDir) { - return null; - } - - final Set result = new HashSet(); - - final SVNLogClient client = myVcs.createLogClient(); - client.doList(myRepository.getLocation().appendPath(path, true), SVNRevision.create(revision), SVNRevision.create(revision), - true, new ISVNDirEntryHandler() { - public void handleDirEntry(final SVNDirEntry dirEntry) throws SVNException { - result.add(dirEntry.getRelativePath()); - } - }); - - return result; - } - catch (SVNException e) { - LOG.error(e); - return null; - } - } - public SvnChangeList(SvnVcs vcs, @NotNull SvnRepositoryLocation location, DataInput stream) throws IOException { myVcs = vcs; myLocation = location; - myDirectories = new HashMap(); readFromStream(stream); - initRepository(); updateBranchInfo(); } - private void initRepository() { - try { - myRepository = myVcs.createRepository(myRepositoryRoot); - } - catch (SVNException e) { - LOG.error(e); - } - } - public String getCommitterName() { return myAuthor; } @@ -213,16 +141,6 @@ public class SvnChangeList implements CommittedChangeList { return myLocation.getLocalPath(fullPath, new DirectoryDetector() { public boolean isDirectory() { - try { - if (myDirectories.containsKey(path)) { - return Boolean.TRUE.equals(myDirectories.get(path)); - } - return ((myRepository != null) && SVNNodeKind.DIR.equals(myRepository.checkPath(path, revision))); - } - catch (SVNException e) { - LOG.error(e); - } - return false; } }); -- 2.11.4.GIT