Search in sources :

Example 1 with RootUrlInfo

use of org.jetbrains.idea.svn.RootUrlInfo in project intellij-community by JetBrains.

the class SvnMergeInfoTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    myTrunkUrl = myRepoUrl + "/trunk";
    myBranchUrl = myRepoUrl + "/branch";
    myBranchVcsRoot = new File(myTempDirFixture.getTempDirPath(), "branch");
    myBranchVcsRoot.mkdir();
    myProjectLevelVcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(myProject);
    myProjectLevelVcsManager.setDirectoryMapping(myBranchVcsRoot.getAbsolutePath(), SvnVcs.VCS_NAME);
    VirtualFile vcsRoot = LocalFileSystem.getInstance().findFileByIoFile(myBranchVcsRoot);
    Node node = new Node(vcsRoot, SVNURL.parseURIEncoded(myBranchUrl), SVNURL.parseURIEncoded(myRepoUrl));
    RootUrlInfo root = new RootUrlInfo(node, WorkingCopyFormat.ONE_DOT_SIX, vcsRoot, null);
    myWCInfo = new WCInfo(root, true, Depth.INFINITY);
    myMergeContext = new MergeContext(SvnVcs.getInstance(myProject), myTrunkUrl, myWCInfo, SVNPathUtil.tail(myTrunkUrl), vcsRoot);
    myOneShotMergeInfoHelper = new OneShotMergeInfoHelper(myMergeContext);
    myVcs = SvnVcs.getInstance(myProject);
    myVcs.getSvnConfiguration().setCheckNestedForQuickMerge(true);
    enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
    enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
    final String repoUrl = SVNURL.parseURIDecoded(myRepoUrl).toString();
    myWCInfoWithBranches = new WCInfoWithBranches(myWCInfo, Collections.emptyList(), vcsRoot, new WCInfoWithBranches.Branch(repoUrl + "/trunk"));
    myMergeChecker = new BranchInfo(myVcs, myWCInfoWithBranches, new WCInfoWithBranches.Branch(repoUrl + "/branch"));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) WCInfo(org.jetbrains.idea.svn.dialogs.WCInfo) BranchInfo(org.jetbrains.idea.svn.mergeinfo.BranchInfo) Node(org.jetbrains.idea.svn.Node) RootUrlInfo(org.jetbrains.idea.svn.RootUrlInfo) MergeContext(org.jetbrains.idea.svn.integrate.MergeContext) OneShotMergeInfoHelper(org.jetbrains.idea.svn.mergeinfo.OneShotMergeInfoHelper) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) WCInfoWithBranches(org.jetbrains.idea.svn.dialogs.WCInfoWithBranches)

Example 2 with RootUrlInfo

use of org.jetbrains.idea.svn.RootUrlInfo in project intellij-community by JetBrains.

the class SvnExternalCommitNoticedTest method testExternalRootSwitch.

@Test
public void testExternalRootSwitch() throws Exception {
    final String branchUrl = prepareBranchesStructure();
    final SubTree tree = new SubTree(myWorkingCopyDir);
    myVcs.invokeRefreshSvnRoots();
    clManager.ensureUpToDate(false);
    clManager.ensureUpToDate(false);
    SvnFileUrlMapping workingCopies = myVcs.getSvnFileUrlMapping();
    List<RootUrlInfo> infos = workingCopies.getAllWcInfos();
    Assert.assertEquals(1, infos.size());
    Assert.assertEquals(myRepoUrl + "/trunk", infos.get(0).getAbsoluteUrl());
    runInAndVerifyIgnoreOutput("switch", branchUrl, myWorkingCopyDir.getPath());
    myWorkingCopyDir.refresh(false, true);
    imitateEvent(myWorkingCopyDir);
    sleep(300);
    // no dirty scope externally provided! just VFS refresh
    clManager.ensureUpToDate(false);
    //first run queries one more update
    clManager.ensureUpToDate(false);
    workingCopies = myVcs.getSvnFileUrlMapping();
    infos = workingCopies.getAllWcInfos();
    Assert.assertEquals(1, infos.size());
    Assert.assertEquals(branchUrl, infos.get(0).getAbsoluteUrl());
}
Also used : SvnFileUrlMapping(org.jetbrains.idea.svn.SvnFileUrlMapping) RootUrlInfo(org.jetbrains.idea.svn.RootUrlInfo) Test(org.junit.Test)

Example 3 with RootUrlInfo

use of org.jetbrains.idea.svn.RootUrlInfo in project intellij-community by JetBrains.

the class SingleCommittedListProvider method setup.

private boolean setup() {
    boolean result = false;
    RootUrlInfo rootUrlInfo = myVcs.getSvnFileUrlMapping().getWcRootForFilePath(virtualToIoFile(file));
    if (rootUrlInfo != null) {
        changeList = new SvnChangeList[1];
        revisionBefore = ((SvnRevisionNumber) number).getRevision();
        repositoryUrl = rootUrlInfo.getRepositoryUrlUrl();
        svnRootUrl = rootUrlInfo.getAbsoluteUrlAsUrl();
        svnRootLocation = new SvnRepositoryLocation(rootUrlInfo.getAbsoluteUrl());
        repositoryRelativeUrl = SvnUtil.ensureStartSlash(SvnUtil.join(SvnUtil.getRelativeUrl(repositoryUrl.toDecodedString(), svnRootUrl.toDecodedString()), SvnUtil.getRelativePath(rootUrlInfo.getPath(), file.getPath())));
        filePath = VcsUtil.getFilePath(file);
        result = true;
    }
    return result;
}
Also used : RootUrlInfo(org.jetbrains.idea.svn.RootUrlInfo)

Example 4 with RootUrlInfo

use of org.jetbrains.idea.svn.RootUrlInfo in project intellij-community by JetBrains.

the class WcInfoLoader method createInfo.

@Nullable
private WCInfoWithBranches createInfo(@NotNull WCInfo info) {
    if (!info.getFormat().supportsMergeInfo()) {
        return null;
    }
    final String url = info.getUrl().toString();
    if (myLocation != null && !myLocation.toPresentableString().startsWith(url) && !url.startsWith(myLocation.toPresentableString())) {
        return null;
    }
    if (!SvnUtil.checkRepositoryVersion15(myVcs, url)) {
        return null;
    }
    // check of WC version
    RootUrlInfo rootForUrl = myVcs.getSvnFileUrlMapping().getWcRootForUrl(url);
    return rootForUrl != null ? createInfoWithBranches(info, rootForUrl) : null;
}
Also used : RootUrlInfo(org.jetbrains.idea.svn.RootUrlInfo) Nullable(org.jetbrains.annotations.Nullable)

Example 5 with RootUrlInfo

use of org.jetbrains.idea.svn.RootUrlInfo in project intellij-community by JetBrains.

the class LatestExistentSearcher method detectStartRevision.

private boolean detectStartRevision() {
    if (!myStartExistsKnown) {
        final SvnFileUrlMapping mapping = myVcs.getSvnFileUrlMapping();
        final RootUrlInfo rootUrlInfo = mapping.getWcRootForUrl(myUrl.toString());
        if (rootUrlInfo == null)
            return true;
        final VirtualFile vf = rootUrlInfo.getVirtualFile();
        final Info info = myVcs.getInfo(vf);
        if ((info == null) || (info.getRevision() == null)) {
            return false;
        }
        myStartNumber = info.getRevision().getNumber();
        myStartExistsKnown = true;
    }
    return true;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) SvnFileUrlMapping(org.jetbrains.idea.svn.SvnFileUrlMapping) RootUrlInfo(org.jetbrains.idea.svn.RootUrlInfo) RootUrlInfo(org.jetbrains.idea.svn.RootUrlInfo) Info(org.jetbrains.idea.svn.info.Info)

Aggregations

RootUrlInfo (org.jetbrains.idea.svn.RootUrlInfo)10 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 File (java.io.File)3 Nullable (org.jetbrains.annotations.Nullable)3 SvnFileUrlMapping (org.jetbrains.idea.svn.SvnFileUrlMapping)3 WCInfo (org.jetbrains.idea.svn.dialogs.WCInfo)2 UsageDescriptor (com.intellij.internal.statistic.beans.UsageDescriptor)1 FilePath (com.intellij.openapi.vcs.FilePath)1 NotNull (org.jetbrains.annotations.NotNull)1 Node (org.jetbrains.idea.svn.Node)1 SvnVcs (org.jetbrains.idea.svn.SvnVcs)1 WCInfoWithBranches (org.jetbrains.idea.svn.dialogs.WCInfoWithBranches)1 Info (org.jetbrains.idea.svn.info.Info)1 MergeContext (org.jetbrains.idea.svn.integrate.MergeContext)1 BranchInfo (org.jetbrains.idea.svn.mergeinfo.BranchInfo)1 OneShotMergeInfoHelper (org.jetbrains.idea.svn.mergeinfo.OneShotMergeInfoHelper)1 Test (org.junit.Test)1 SVNURL (org.tmatesoft.svn.core.SVNURL)1