Search in sources :

Example 6 with Info

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

the class CreateBranchOrTagDialog method isOKActionEnabled.

public boolean isOKActionEnabled() {
    myErrorLabel.setText(" ");
    if (myURL == null) {
        return false;
    }
    if (myBranchOrTagRadioButton.isSelected() && myBranchTagBaseComboBox.getComboBox().getSelectedItem() == null) {
        myErrorLabel.setText(SvnBundle.message("create.branch.no.base.location.error"));
        return false;
    }
    String url = getToURL();
    if (url != null && url.trim().length() > 0) {
        if (myRepositoryRadioButton.isSelected()) {
            SVNRevision revision;
            try {
                revision = myRevisionPanel.getRevision();
            } catch (ConfigurationException e) {
                revision = SVNRevision.UNDEFINED;
            }
            if (!revision.isValid() || revision.isLocal()) {
                myErrorLabel.setText(SvnBundle.message("create.branch.invalid.revision.error", myRevisionPanel.getRevisionText()));
                return false;
            }
            return true;
        } else if (myWorkingCopyRadioButton.isSelected()) {
            Info info = SvnVcs.getInstance(myProject).getInfo(mySrcFile);
            String srcUrl = info != null && info.getURL() != null ? info.getURL().toString() : null;
            if (srcUrl == null) {
                myErrorLabel.setText(SvnBundle.message("create.branch.no.working.copy.error", myWorkingCopyField.getText()));
                return false;
            }
            return true;
        }
    }
    return false;
}
Also used : ConfigurationException(com.intellij.openapi.options.ConfigurationException) SVNRevision(org.tmatesoft.svn.core.wc.SVNRevision) RootUrlInfo(org.jetbrains.idea.svn.RootUrlInfo) Info(org.jetbrains.idea.svn.info.Info)

Example 7 with Info

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

the class RootsToWorkingCopies method calculateRoot.

@Nullable
private WorkingCopy calculateRoot(@NotNull VirtualFile root) {
    File workingCopyRoot = SvnUtil.getWorkingCopyRootNew(virtualToIoFile(root));
    WorkingCopy workingCopy = null;
    if (workingCopyRoot != null) {
        final Info svnInfo = myVcs.getInfo(workingCopyRoot);
        if (svnInfo != null && svnInfo.getURL() != null) {
            workingCopy = new WorkingCopy(workingCopyRoot, svnInfo.getURL(), true);
        }
    }
    return registerWorkingCopy(root, workingCopy);
}
Also used : Info(org.jetbrains.idea.svn.info.Info) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) Nullable(org.jetbrains.annotations.Nullable)

Example 8 with Info

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

the class SvnFileUrlMappingImpl method fillMapping.

private void fillMapping(final SvnMapping mapping, final List<SvnCopyRootSimple> list) {
    final LocalFileSystem lfs = LocalFileSystem.getInstance();
    for (SvnCopyRootSimple simple : list) {
        final VirtualFile copyRoot = lfs.findFileByIoFile(new File(simple.myCopyRoot));
        final VirtualFile vcsRoot = lfs.findFileByIoFile(new File(simple.myVcsRoot));
        if (copyRoot == null || vcsRoot == null)
            continue;
        final SvnVcs vcs = SvnVcs.getInstance(myProject);
        final Info svnInfo = vcs.getInfo(copyRoot);
        if ((svnInfo == null) || (svnInfo.getRepositoryRootURL() == null))
            continue;
        Node node = new Node(copyRoot, svnInfo.getURL(), svnInfo.getRepositoryRootURL());
        final RootUrlInfo info = new RootUrlInfo(node, SvnFormatSelector.findRootAndGetFormat(svnInfo.getFile()), vcsRoot);
        mapping.add(info);
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) LocalFileSystem(com.intellij.openapi.vfs.LocalFileSystem) Info(org.jetbrains.idea.svn.info.Info) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File)

Example 9 with Info

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

the class SvnParseCommandLineParseTest method testInfo.

public void testInfo() throws Exception {
    final String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<info>\n" + "<entry\n" + "   path=\"ReduceReturnOrYieldBreakTransformation.cs\"\n" + "   revision=\"91603\"\n" + "   kind=\"file\">\n" + "<url>http://svn.labs.intellij.net/resharper/trunk/ReSharper/src/Decompiler.Core/Src/Transformations/StatementStructure/ReduceReturnOrYieldBreakTransformation.cs</url>\n" + "<repository>\n" + "<root>http://svn.labs.intellij.net/resharper</root>\n" + "<uuid>ed0594e5-7722-0410-9c76-949374689613</uuid>\n" + "</repository>\n" + "<wc-info>\n" + "<wcroot-abspath>C:/TestProjects/sortedProjects/Subversion/Resharper17short</wcroot-abspath>\n" + "<schedule>normal</schedule>\n" + "<depth>infinity</depth>\n" + "<text-updated>2012-01-20T11:25:32.625000Z</text-updated>\n" + "<checksum>7af8adacb93afaa48b2cfb76de605824c220983a</checksum>\n" + "</wc-info>\n" + "<commit\n" + "   revision=\"87972\">\n" + "<author>Slava.Trenogin</author>\n" + "<date>2011-10-06T21:27:41.539022Z</date>\n" + "</commit>\n" + "</entry>\n" + "</info>";
    final Info[] info = new Info[1];
    final SvnInfoHandler handler = new SvnInfoHandler(new File("C:/base/"), info1 -> info[0] = info1);
    SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
    parser.parse(new ByteArrayInputStream(s.getBytes(CharsetToolkit.UTF8_CHARSET)), handler);
    Assert.assertNotNull(info[0]);
}
Also used : SvnInfoHandler(org.jetbrains.idea.svn.info.SvnInfoHandler) ByteArrayInputStream(java.io.ByteArrayInputStream) SAXParser(javax.xml.parsers.SAXParser) Info(org.jetbrains.idea.svn.info.Info) SystemInfo(com.intellij.openapi.util.SystemInfo) File(java.io.File)

Example 10 with Info

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

the class SvnMergeInfoTest method testMixedWorkingRevisions.

@Test
public void testMixedWorkingRevisions() throws Exception {
    createOneFolderStructure();
    // rev 3
    editAndCommit(trunk, f1);
    // rev 4: record non inheritable merge
    setMergeInfo(myBranchVcsRoot, "/trunk:3");
    commitFile(myBranchVcsRoot);
    // ! no update!
    assertMergeInfo(myBranchVcsRoot, "/trunk:3");
    final Info f1info = myVcs.getInfo(new File(myBranchVcsRoot, "folder/f1.txt"));
    assert f1info.getRevision().getNumber() == 2;
    final List<SvnChangeList> changeListList = getTrunkChangeLists();
    final SvnChangeList changeList = changeListList.get(0);
    assertMergeResult(changeList, SvnMergeInfoCache.MergeCheckResult.NOT_MERGED);
    // and after update
    updateFile(myBranchVcsRoot);
    myMergeChecker.clear();
    assertMergeResult(changeList, SvnMergeInfoCache.MergeCheckResult.MERGED);
}
Also used : SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) WCInfo(org.jetbrains.idea.svn.dialogs.WCInfo) Info(org.jetbrains.idea.svn.info.Info) BranchInfo(org.jetbrains.idea.svn.mergeinfo.BranchInfo) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) Test(org.junit.Test)

Aggregations

Info (org.jetbrains.idea.svn.info.Info)32 File (java.io.File)18 VirtualFile (com.intellij.openapi.vfs.VirtualFile)11 VcsException (com.intellij.openapi.vcs.VcsException)6 NotNull (org.jetbrains.annotations.NotNull)6 SVNURL (org.tmatesoft.svn.core.SVNURL)6 SVNRevision (org.tmatesoft.svn.core.wc.SVNRevision)6 VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)5 RootUrlInfo (org.jetbrains.idea.svn.RootUrlInfo)5 IOException (java.io.IOException)3 Nullable (org.jetbrains.annotations.Nullable)3 Test (org.junit.Test)3 SVNException (org.tmatesoft.svn.core.SVNException)3 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)2 FilePath (com.intellij.openapi.vcs.FilePath)2 ArrayList (java.util.ArrayList)2 SvnVcs (org.jetbrains.idea.svn.SvnVcs)2 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)2 WCInfo (org.jetbrains.idea.svn.dialogs.WCInfo)2 SvnChangeList (org.jetbrains.idea.svn.history.SvnChangeList)2