Search in sources :

Example 1 with WCInfo

use of org.jetbrains.idea.svn.dialogs.WCInfo 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 WCInfo

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

the class SvnQuickMergeTest method getWcInfo.

private WCInfo getWcInfo() {
    WCInfo found = null;
    final File workingIoFile = virtualToIoFile(myWorkingCopyDir);
    final List<WCInfo> infos = myVcs.getAllWcInfos();
    for (WCInfo info : infos) {
        if (FileUtil.filesEqual(workingIoFile, new File(info.getPath()))) {
            found = info;
            break;
        }
    }
    Assert.assertNotNull(found);
    return found;
}
Also used : WCInfo(org.jetbrains.idea.svn.dialogs.WCInfo) VirtualFile(com.intellij.openapi.vfs.VirtualFile) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) File(java.io.File)

Example 3 with WCInfo

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

the class SvnVcs method getAllWcInfos.

/**
   * Returns real working copies roots - if there is <Project Root> -> Subversion setting,
   * and there is one working copy, will return one root
   */
public List<WCInfo> getAllWcInfos() {
    final SvnFileUrlMapping urlMapping = getSvnFileUrlMapping();
    final List<RootUrlInfo> infoList = urlMapping.getAllWcInfos();
    final List<WCInfo> infos = new ArrayList<>();
    for (RootUrlInfo info : infoList) {
        final File file = info.getIoFile();
        infos.add(new WCInfo(info, SvnUtil.isWorkingCopyRoot(file), SvnUtil.getDepth(this, file)));
    }
    return infos;
}
Also used : WCInfo(org.jetbrains.idea.svn.dialogs.WCInfo) VirtualFile(com.intellij.openapi.vfs.VirtualFile) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) File(java.io.File)

Example 4 with WCInfo

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

the class SvnVcs method cleanup17copies.

/**
   * TODO: This seems to be related to some issues when upgrading from 1.6 to 1.7. So it is not currently required for 1.8 and later
   * TODO: formats. And should be removed when 1.6 working copies are no longer supported by IDEA.
   */
private void cleanup17copies() {
    Runnable callCleanupWorker = () -> {
        if (myProject.isDisposed())
            return;
        new CleanupWorker(this, emptyList()) {

            @Override
            protected void fillRoots() {
                for (WCInfo info : getAllWcInfos()) {
                    if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(info.getFormat())) {
                        VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(info.getRootInfo().getIoFile());
                        if (file == null) {
                            LOG.info("Wasn't able to find virtual file for wc root: " + info.getPath());
                        } else {
                            myRoots.add(file);
                        }
                    }
                }
            }
        }.execute();
    };
    myCopiesRefreshManager.waitRefresh(() -> ApplicationManager.getApplication().invokeLater(callCleanupWorker));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) WCInfo(org.jetbrains.idea.svn.dialogs.WCInfo) DumbAwareRunnable(com.intellij.openapi.project.DumbAwareRunnable) CleanupWorker(org.jetbrains.idea.svn.actions.CleanupWorker)

Example 5 with WCInfo

use of org.jetbrains.idea.svn.dialogs.WCInfo 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) 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)

Aggregations

WCInfo (org.jetbrains.idea.svn.dialogs.WCInfo)6 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 File (java.io.File)5 VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)2 RootUrlInfo (org.jetbrains.idea.svn.RootUrlInfo)2 WCInfoWithBranches (org.jetbrains.idea.svn.dialogs.WCInfoWithBranches)2 MergeContext (org.jetbrains.idea.svn.integrate.MergeContext)2 BranchInfo (org.jetbrains.idea.svn.mergeinfo.BranchInfo)2 OneShotMergeInfoHelper (org.jetbrains.idea.svn.mergeinfo.OneShotMergeInfoHelper)2 DumbAwareRunnable (com.intellij.openapi.project.DumbAwareRunnable)1 Nullable (org.jetbrains.annotations.Nullable)1 Node (org.jetbrains.idea.svn.Node)1 CleanupWorker (org.jetbrains.idea.svn.actions.CleanupWorker)1