import org.tmatesoft.svn.core.SVNCancelException;
import org.tmatesoft.svn.core.SVNErrorCode;
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;
-import static org.jetbrains.idea.svn.SvnUtil.createUrl;
import static org.jetbrains.idea.svn.SvnUtil.ensureStartSlash;
-import static org.tmatesoft.svn.core.internal.util.SVNPathUtil.getRelativePath;
+import static org.jetbrains.idea.svn.SvnUtil.getRelativeUrl;
import static org.tmatesoft.svn.core.internal.util.SVNPathUtil.isAncestor;
// TODO: This one seem to determine revision in which branch was created - copied from trunk.
@NotNull private final SvnVcs myVcs;
@NotNull private final String myRepositoryRelativeBranchUrl;
@NotNull private final String myRepositoryRelativeTrunkUrl;
- @NotNull private final String myRepositoryRoot;
+ @NotNull private final SVNURL myRepositoryRoot;
- public FirstInBranch(@NotNull SvnVcs vcs, @NotNull String repositoryRoot, @NotNull String branchUrl, @NotNull String trunkUrl) {
+ public FirstInBranch(@NotNull SvnVcs vcs, @NotNull SVNURL repositoryRoot, @NotNull String branchUrl, @NotNull String trunkUrl) {
myVcs = vcs;
myRepositoryRoot = repositoryRoot;
- myRepositoryRelativeBranchUrl = ensureStartSlash(getRelativePath(repositoryRoot, branchUrl));
- myRepositoryRelativeTrunkUrl = ensureStartSlash(getRelativePath(repositoryRoot, trunkUrl));
+ myRepositoryRelativeBranchUrl = ensureStartSlash(getRelativeUrl(repositoryRoot.toDecodedString(), branchUrl));
+ myRepositoryRelativeTrunkUrl = ensureStartSlash(getRelativeUrl(repositoryRoot.toDecodedString(), trunkUrl));
}
@Nullable
public CopyData run() throws VcsException {
- SvnTarget target = SvnTarget.fromURL(createUrl(myRepositoryRoot));
+ SvnTarget target = SvnTarget.fromURL(myRepositoryRoot);
HistoryClient client = ApplicationManager.getApplication().runReadAction((Computable<HistoryClient>)() -> {
if (myVcs.getProject().isDisposed()) return null;
return myVcs.getFactory(target).createHistoryClient();
import com.intellij.util.Consumer;
import com.intellij.util.continuation.Where;
import org.jetbrains.annotations.NotNull;
+import org.tmatesoft.svn.core.SVNURL;
public class LookForBranchOriginTask extends BaseMergeTask {
@Override
public void run() {
- String repoUrl = myMergeContext.getWcInfo().getRepoUrl();
+ SVNURL repoUrl = myMergeContext.getWcInfo().getRootInfo().getRepositoryUrlUrl();
String sourceUrl = myFromSource ? myMergeContext.getSourceUrl() : myMergeContext.getWcInfo().getRootUrl();
String targetUrl = myFromSource ? myMergeContext.getWcInfo().getRootUrl() : myMergeContext.getSourceUrl();
import org.jetbrains.idea.svn.SvnVcs;
import org.jetbrains.idea.svn.history.CopyData;
import org.jetbrains.idea.svn.history.FirstInBranch;
+import org.tmatesoft.svn.core.SVNURL;
import java.io.DataInput;
import java.io.DataOutput;
}
@Nullable
- public WrapperInvertor calculateCopyPoint(@NotNull String repoUrl, @NotNull String sourceUrl, @NotNull String targetUrl)
+ public WrapperInvertor calculateCopyPoint(@NotNull SVNURL repoUrl, @NotNull String sourceUrl, @NotNull String targetUrl)
throws VcsException {
- WrapperInvertor result = getBestHit(repoUrl, sourceUrl, targetUrl);
+ WrapperInvertor result = getBestHit(repoUrl.toDecodedString(), sourceUrl, targetUrl);
if (result == null) {
CopyData copyData = new FirstInBranch(myVcs, repoUrl, targetUrl, sourceUrl).run();
? new BranchCopyData(sourceUrl, copyData.getCopySourceRevision(), targetUrl, copyData.getCopyTargetRevision())
: new BranchCopyData(targetUrl, copyData.getCopySourceRevision(), sourceUrl, copyData.getCopyTargetRevision());
- persist(repoUrl, branchCopyData);
+ persist(repoUrl.toDecodedString(), branchCopyData);
result = new WrapperInvertor(!copyData.isTrunkSupposedCorrect(), branchCopyData);
}
}
- logCopyData(repoUrl, sourceUrl, targetUrl, result);
+ logCopyData(repoUrl.toDecodedString(), sourceUrl, targetUrl, result);
return result;
}
if (myCopyRevison != null && Comparing.equal(myCopyRevison.getPath(), branchPath)) {
return myCopyRevison.getRevision();
}
- myCopyRevison = new SvnMergeInfoCache.CopyRevison(myVcs, branchPath, myInfo.getRepoUrl(), myBranch.getUrl(), myInfo.getRootUrl());
+ myCopyRevison = new SvnMergeInfoCache.CopyRevison(myVcs, branchPath, myInfo.getRootInfo().getRepositoryUrlUrl(), myBranch.getUrl(),
+ myInfo.getRootUrl());
return -1;
}
import org.jetbrains.idea.svn.history.CopyData;
import org.jetbrains.idea.svn.history.FirstInBranch;
import org.jetbrains.idea.svn.history.SvnChangeList;
+import org.tmatesoft.svn.core.SVNURL;
import java.util.Map;
private final String myPath;
private volatile long myRevision;
- CopyRevison(final SvnVcs vcs, final String path, final String repositoryRoot, final String branchUrl, final String trunkUrl) {
+ CopyRevison(final SvnVcs vcs, final String path, @NotNull SVNURL repositoryRoot, final String branchUrl, final String trunkUrl) {
myPath = path;
myRevision = -1;