Search in sources :

Example 11 with SvnRepositoryLocation

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

the class SvnRevisionPanel method chooseRevision.

private void chooseRevision() {
    if (myProject != null && myUrlProvider != null) {
        final SvnRepositoryLocation location = new SvnRepositoryLocation(myUrlProvider.getUrl());
        final SvnChangeList version = SvnSelectRevisionUtil.chooseCommittedChangeList(myProject, location, myRoot);
        if (version != null) {
            myRevisionField.setText(String.valueOf(version.getNumber()));
        }
    }
}
Also used : SvnRepositoryLocation(org.jetbrains.idea.svn.history.SvnRepositoryLocation) SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList)

Example 12 with SvnRepositoryLocation

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

the class MergeCalculatorTask method getChangeLists.

@NotNull
private static <T> List<T> getChangeLists(@NotNull MergeContext mergeContext, @NotNull ChangeBrowserSettings settings, long revisionToExclude, int size, @NotNull PairFunction<SvnChangeList, LogHierarchyNode, T> resultProvider) throws VcsException {
    List<T> result = newArrayList();
    ((SvnCommittedChangesProvider) mergeContext.getVcs().getCommittedChangesProvider()).getCommittedChangesWithMergedRevisons(settings, new SvnRepositoryLocation(mergeContext.getSourceUrl()), size > 0 ? size + (revisionToExclude > 0 ? 2 : 1) : 0, (changeList, tree) -> {
        if (revisionToExclude != changeList.getNumber()) {
            result.add(resultProvider.fun(changeList, tree));
        }
    });
    return result;
}
Also used : SvnRepositoryLocation(org.jetbrains.idea.svn.history.SvnRepositoryLocation) SvnCommittedChangesProvider(org.jetbrains.idea.svn.history.SvnCommittedChangesProvider) NotNull(org.jetbrains.annotations.NotNull)

Example 13 with SvnRepositoryLocation

use of org.jetbrains.idea.svn.history.SvnRepositoryLocation 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 14 with SvnRepositoryLocation

use of org.jetbrains.idea.svn.history.SvnRepositoryLocation 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 15 with SvnRepositoryLocation

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

the class SvnCommittedViewTest method testCopyDir.

@Test
public void testCopyDir() 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");
    runInAndVerifyIgnoreOutput("copy", "-m", "test", myRepoUrl + "/trunk", myRepoUrl + "/branch");
    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") });
}
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) SvnVcs(org.jetbrains.idea.svn.SvnVcs) Test(org.junit.Test)

Aggregations

SvnRepositoryLocation (org.jetbrains.idea.svn.history.SvnRepositoryLocation)17 SvnChangeList (org.jetbrains.idea.svn.history.SvnChangeList)16 ChangeBrowserSettings (com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings)15 VirtualFile (com.intellij.openapi.vfs.VirtualFile)14 Test (org.junit.Test)14 SvnVcs (org.jetbrains.idea.svn.SvnVcs)7 VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)5 File (java.io.File)5 NotNull (org.jetbrains.annotations.NotNull)2 SvnCommittedChangesProvider (org.jetbrains.idea.svn.history.SvnCommittedChangesProvider)1