Search in sources :

Example 31 with Info

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

the class SvnChangeProviderContext method addModifiedNotSavedChange.

public void addModifiedNotSavedChange(@NotNull VirtualFile file) throws SVNException {
    final FilePath filePath = VcsUtil.getFilePath(file);
    final Info svnInfo = myVcs.getInfo(file);
    if (svnInfo != null) {
        final Status svnStatus = new Status();
        svnStatus.setRevision(svnInfo.getRevision());
        svnStatus.setKind(NodeKind.from(filePath.isDirectory()));
        processChangeInList(SvnContentRevision.createBaseRevision(myVcs, filePath, svnInfo.getRevision()), CurrentContentRevision.create(filePath), FileStatus.MODIFIED, svnStatus);
    }
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) FileStatus(com.intellij.openapi.vcs.FileStatus) Status(org.jetbrains.idea.svn.status.Status) Info(org.jetbrains.idea.svn.info.Info)

Example 32 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) RootUrlInfo(org.jetbrains.idea.svn.RootUrlInfo) 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