Commit a37a1f86 authored by Florent Angebault's avatar Florent Angebault

fixup! Bugfix: Regression: branch comparison ignores local additions.

parent 4e4a77a8
......@@ -17,6 +17,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
......@@ -238,30 +239,27 @@ public class ThreeWayResourceCompareInput extends ResourceCompareInput implement
public void initialize(IProgressMonitor monitor) throws Exception {
Map<String, SVNDiffStatus> localChanges = new HashMap<String, SVNDiffStatus>();
Map<String, SVNDiffStatus> remoteChanges = new HashMap<String, SVNDiffStatus>();
Map<SVNDiffStatus, String> allChanges = new HashMap<SVNDiffStatus, String>();
HashSet<String> localOnly = new HashSet<String>();
SVNDiffStatus []rChanges = this.remoteChanges.toArray(new SVNDiffStatus[this.remoteChanges.size()]);
SVNUtility.reorder(rChanges, true);
for (Iterator<SVNDiffStatus> it = this.localChanges.iterator(); it.hasNext() && !monitor.isCanceled(); ) {
SVNDiffStatus status = it.next();
localChanges.put(status.pathPrev, status);
allChanges.put(status, status.pathPrev);
}
for (Iterator<SVNDiffStatus> it = this.remoteChanges.iterator(); it.hasNext() && !monitor.isCanceled(); ) {
SVNDiffStatus status = it.next();
String localPath = this.getLocalPath(SVNUtility.decodeURL(status.pathPrev), this.rootAncestor);
remoteChanges.put(localPath, status);
allChanges.put(status, localPath);
localOnly.add(status.pathPrev);
}
SVNDiffStatus[] allChangedStatuses = allChanges.keySet().toArray(new SVNDiffStatus[allChanges.size()]);
SVNUtility.reorder(allChangedStatuses, true);
HashMap path2node = new HashMap();
String message = SVNUIMessages.ResourceCompareInput_CheckingDelta;
for (int i = 0; i < allChangedStatuses.length && !monitor.isCanceled(); i++) {
SVNDiffStatus status = allChangedStatuses[i];
String changePath = allChanges.get(status);
monitor.subTask(BaseMessages.format(message, new Object[] {changePath}));
this.makeBranch(changePath, localChanges.get(changePath), remoteChanges.get(changePath), path2node, monitor);
ProgressMonitorUtility.progress(monitor, i, allChanges.size());
for (int i = 0; i < rChanges.length && !monitor.isCanceled(); i++) {
SVNDiffStatus status = rChanges[i];
String localPath = this.getLocalPath(SVNUtility.decodeURL(status.pathPrev), this.rootAncestor);
localOnly.remove(localPath);
monitor.subTask(BaseMessages.format(message, new Object[] {localPath}));
this.makeBranch(localPath, localChanges.get(localPath), status, path2node, monitor);
ProgressMonitorUtility.progress(monitor, i, rChanges.length);
}
for (String localPath : localOnly) {
this.makeBranch(localPath, localChanges.get(localPath), null, path2node, monitor);
}
this.findRootNode(path2node, this.rootLeft, monitor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment