mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-118908 svn: Fixed url validation for "Merge From" action to use SVNURL instances (instead of just strings)
This commit is contained in:
@@ -60,6 +60,7 @@ import org.tmatesoft.svn.core.SVNLogEntry;
|
||||
import org.tmatesoft.svn.core.SVNLogEntryPath;
|
||||
import org.tmatesoft.svn.core.SVNURL;
|
||||
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
|
||||
import org.tmatesoft.svn.core.internal.util.SVNURLUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -115,7 +116,12 @@ public class QuickMerge {
|
||||
|
||||
@Override
|
||||
public void run(ContinuationContext continuationContext) {
|
||||
if (SVNPathUtil.isAncestor(mySourceUrl, myWcInfo.getRootUrl()) || SVNPathUtil.isAncestor(myWcInfo.getRootUrl(), mySourceUrl)) {
|
||||
SVNURL url = parseUrl(continuationContext);
|
||||
if (url == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (SVNURLUtil.isAncestor(url, myWcInfo.getUrl()) || SVNURLUtil.isAncestor(myWcInfo.getUrl(), url)) {
|
||||
finishWithError(continuationContext, "Cannot merge from self", true);
|
||||
return;
|
||||
}
|
||||
@@ -124,6 +130,20 @@ public class QuickMerge {
|
||||
continuationContext.cancelEverything();
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private SVNURL parseUrl(ContinuationContext continuationContext) {
|
||||
SVNURL url = null;
|
||||
|
||||
try {
|
||||
url = SvnUtil.createUrl(mySourceUrl);
|
||||
}
|
||||
catch (SVNException e) {
|
||||
finishWithError(continuationContext, e.getMessage(), true);
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
private class CheckRepositorySupportsMergeinfo extends TaskDescriptor {
|
||||
|
||||
@@ -30,6 +30,9 @@ import org.tmatesoft.svn.core.wc.SVNRevision;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
// TODO: This one seem to determine revision in which branch was created - copied from trunk.
|
||||
// TODO: This could be done in one command "svn log <folder> -r 0:HEAD --stop-on-copy --limit 1".
|
||||
// TODO: Check for 1.7 and rewrite using this approach.
|
||||
public class FirstInBranch implements Runnable {
|
||||
private final SvnVcs myVcs;
|
||||
private final String myBranchUrl;
|
||||
|
||||
Reference in New Issue
Block a user