Search in sources :

Example 26 with SvnChangeList

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

the class MergeCalculatorTask method getNotMergedChangeLists.

@NotNull
private List<SvnChangeList> getNotMergedChangeLists(@NotNull List<Pair<SvnChangeList, LogHierarchyNode>> changeLists) {
    List<SvnChangeList> result = newArrayList();
    progress("Collecting not merged revisions");
    for (Pair<SvnChangeList, LogHierarchyNode> pair : changeLists) {
        SvnChangeList changeList = pair.getFirst();
        progress2(message("progress.text2.processing.revision", changeList.getNumber()));
        if (MergeCheckResult.NOT_MERGED.equals(myMergeChecker.checkList(changeList)) && !myMergeChecker.checkListForPaths(pair.getSecond())) {
            result.add(changeList);
        }
    }
    return result;
}
Also used : SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) LogHierarchyNode(org.jetbrains.idea.svn.history.LogHierarchyNode) NotNull(org.jetbrains.annotations.NotNull)

Example 27 with SvnChangeList

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

the class SvnMergeInfoTest method testWhenInfoInRepo.

@Test
public void testWhenInfoInRepo() throws Exception {
    final File fullBranch = newFolder(myTempDirFixture.getTempDirPath(), "fullBranch");
    createTwoFolderStructure(fullBranch);
    // folder1 will be taken as branch wc root
    checkOutFile(myBranchUrl + "/folder/folder1", myBranchVcsRoot);
    // rev 3 : f2 changed
    editAndCommit(trunk, f2);
    // rev 4: record as merged into branch using full branch WC
    recordMerge(fullBranch, myTrunkUrl, "-c", "3");
    commitFile(fullBranch);
    updateFile(myBranchVcsRoot);
    final List<SvnChangeList> changeListList = getTrunkChangeLists();
    assertRevisions(changeListList, 3);
    assertMergeResult(changeListList.get(0), SvnMergeInfoCache.MergeCheckResult.MERGED);
}
Also used : SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) Test(org.junit.Test)

Example 28 with SvnChangeList

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

the class SvnCommittedViewTest method testCopyAndModify.

@Test
public void testCopyAndModify() throws Exception {
    final File trunk = new File(myTempDirFixture.getTempDirPath(), "trunk");
    trunk.mkdir();
    Thread.sleep(100);
    final File folder = new File(trunk, "folder");
    folder.mkdir();
    Thread.sleep(100);
    new File(folder, "f1.txt").createNewFile();
    new File(folder, "f2.txt").createNewFile();
    Thread.sleep(100);
    runInAndVerifyIgnoreOutput("import", "-m", "test", trunk.getAbsolutePath(), myRepoUrl + "/trunk");
    update();
    runInAndVerifyIgnoreOutput("copy", myWorkingCopyDir.getPath() + "/trunk", myWorkingCopyDir.getPath() + "/branch");
    runInAndVerifyIgnoreOutput("propset", "testprop", "testval", myWorkingCopyDir.getPath() + "/branch/folder");
    checkin();
    final SvnVcs vcs = SvnVcs.getInstance(myProject);
    vcs.invokeRefreshSvnRoots();
    final CommittedChangesProvider<SvnChangeList, ChangeBrowserSettings> committedChangesProvider = vcs.getCommittedChangesProvider();
    final List<SvnChangeList> changeListList = committedChangesProvider.getCommittedChanges(committedChangesProvider.createDefaultSettings(), new SvnRepositoryLocation(myRepoUrl + "/branch"), 0);
    checkList(changeListList, 2, new Data[] { new Data(new File(myWorkingCopyDir.getPath(), "branch").getAbsolutePath(), FileStatus.ADDED, "- copied from /trunk"), new Data(new File(myWorkingCopyDir.getPath(), "branch/folder").getAbsolutePath(), FileStatus.MODIFIED, "- copied from /trunk/folder") });
}
Also used : SvnRepositoryLocation(org.jetbrains.idea.svn.history.SvnRepositoryLocation) SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) ChangeBrowserSettings(com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) Test(org.junit.Test)

Example 29 with SvnChangeList

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

the class SvnCommittedViewTest method testReplaced.

@Test
public void testReplaced() throws Exception {
    enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
    enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
    VirtualFile d1 = createDirInCommand(myWorkingCopyDir, "d1");
    VirtualFile f11 = createFileInCommand(d1, "f11.txt", "123\n456");
    VirtualFile f12 = createFileInCommand(d1, "f12.txt", "----");
    // r1, addition without history
    checkin();
    File dir = virtualToIoFile(d1);
    final String d1Path = dir.getAbsolutePath();
    runInAndVerifyIgnoreOutput("delete", d1Path);
    boolean created = dir.mkdir();
    Assert.assertTrue(created);
    runInAndVerifyIgnoreOutput("add", d1Path);
    checkin();
    final SvnVcs vcs = SvnVcs.getInstance(myProject);
    vcs.invokeRefreshSvnRoots();
    final CommittedChangesProvider<SvnChangeList, ChangeBrowserSettings> committedChangesProvider = vcs.getCommittedChangesProvider();
    final List<SvnChangeList> changeListList = committedChangesProvider.getCommittedChanges(committedChangesProvider.createDefaultSettings(), new SvnRepositoryLocation(myRepoUrl), 0);
    checkList(changeListList, 2, new Data[] { new Data(absPath(d1), FileStatus.MODIFIED, "- replaced") });
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) SvnRepositoryLocation(org.jetbrains.idea.svn.history.SvnRepositoryLocation) SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) ChangeBrowserSettings(com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) Test(org.junit.Test)

Example 30 with SvnChangeList

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

the class SelectedChangeListsChecker method checkSame.

private void checkSame() {
    final CheckSamePattern<SVNURL> sameBranch = new CheckSamePattern<>();
    final CheckSamePattern<VirtualFile> sameRoot = new CheckSamePattern<>();
    for (ChangeList changeList : myChangeListsList) {
        final SvnChangeList svnChangeList = (SvnChangeList) changeList;
        sameBranch.iterate(svnChangeList.getBranchUrl());
        sameRoot.iterate(svnChangeList.getRoot());
        if ((!sameBranch.isSame()) || (!sameRoot.isSame())) {
            break;
        }
    }
    isValid = sameBranch.isSame() && sameRoot.isSame();
    mySameBranch = sameBranch.getSameValue();
    myVcsRoot = sameRoot.getSameValue();
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) ChangeList(com.intellij.openapi.vcs.changes.ChangeList) CommittedChangeList(com.intellij.openapi.vcs.versionBrowser.CommittedChangeList) SVNURL(org.tmatesoft.svn.core.SVNURL)

Aggregations

SvnChangeList (org.jetbrains.idea.svn.history.SvnChangeList)37 VirtualFile (com.intellij.openapi.vfs.VirtualFile)23 Test (org.junit.Test)22 ChangeBrowserSettings (com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings)16 SvnRepositoryLocation (org.jetbrains.idea.svn.history.SvnRepositoryLocation)16 File (java.io.File)13 SvnVcs (org.jetbrains.idea.svn.SvnVcs)7 VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)4 NotNull (org.jetbrains.annotations.NotNull)4 Change (com.intellij.openapi.vcs.changes.Change)3 ChangeList (com.intellij.openapi.vcs.changes.ChangeList)3 CommittedChangeList (com.intellij.openapi.vcs.versionBrowser.CommittedChangeList)3 Project (com.intellij.openapi.project.Project)2 VcsException (com.intellij.openapi.vcs.VcsException)2 ContainerUtilRt.emptyList (com.intellij.util.containers.ContainerUtilRt.emptyList)2 KeyAdapter (java.awt.event.KeyAdapter)2 KeyEvent (java.awt.event.KeyEvent)2 MouseEvent (java.awt.event.MouseEvent)2 ArrayList (java.util.ArrayList)2 Collections.singletonList (java.util.Collections.singletonList)2