use of org.jetbrains.idea.svn.history.SvnChangeList 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") });
}
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") });
}
use of org.jetbrains.idea.svn.history.SvnChangeList in project intellij-community by JetBrains.
the class SvnCommittedViewTest method testMoveDir.
@Test
public void testMoveDir() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
VirtualFile d1 = createDirInCommand(myWorkingCopyDir, "d1");
VirtualFile d2 = createDirInCommand(myWorkingCopyDir, "d2");
VirtualFile f11 = createFileInCommand(d1, "f11.txt", "123\n456");
VirtualFile f12 = createFileInCommand(d1, "f12.txt", "----");
// r1, addition without history
checkin();
final String oldPath = absPath(d1);
moveFileInCommand(d1, d2);
Thread.sleep(100);
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, "- moved from .." + File.separatorChar + "d1") });
}
use of org.jetbrains.idea.svn.history.SvnChangeList in project intellij-community by JetBrains.
the class SvnMergeInfoTest method testTwoPaths.
@Test
public void testTwoPaths() throws Exception {
createTwoFolderStructure(myBranchVcsRoot);
// rev 3
editFile(f1);
editFile(f2);
commitFile(trunk);
updateFile(myBranchVcsRoot);
// rev 4: record non inheritable merge
setMergeInfo(myBranchVcsRoot, "/trunk:3");
// this makes not merged for f2 path
setMergeInfo(new File(myBranchVcsRoot, "folder/folder1"), "/trunk:3*");
commitFile(myBranchVcsRoot);
updateFile(myBranchVcsRoot);
assertMergeInfo(myBranchVcsRoot, "/trunk:3");
assertMergeInfo(new File(myBranchVcsRoot, "folder/folder1"), "/trunk:3*");
final List<SvnChangeList> changeListList = getTrunkChangeLists();
assertRevisions(changeListList, 3);
assertMergeResult(changeListList, SvnMergeInfoCache.MergeCheckResult.NOT_MERGED);
}
use of org.jetbrains.idea.svn.history.SvnChangeList in project intellij-community by JetBrains.
the class SvnMergeInfoTest method testOnlyImmediateInheritableMergeinfo.
@Test
public void testOnlyImmediateInheritableMergeinfo() throws Exception {
createOneFolderStructure();
// rev 3
editAndCommit(trunk, f1, CONTENT1);
// rev4
editAndCommit(trunk, f1, CONTENT2);
updateFile(myBranchVcsRoot);
// rev 4: record non inheritable merge
setMergeInfo(myBranchVcsRoot, "/trunk:3,4");
setMergeInfo(new File(myBranchVcsRoot, "folder"), "/trunk:3");
commitFile(myBranchVcsRoot);
updateFile(myBranchVcsRoot);
assertMergeInfo(myBranchVcsRoot, "/trunk:3-4", "/trunk:3,4");
assertMergeInfo(new File(myBranchVcsRoot, "folder"), "/trunk:3");
final List<SvnChangeList> changeListList = getTrunkChangeLists();
assertRevisions(changeListList, 4, 3);
assertMergeResult(changeListList, SvnMergeInfoCache.MergeCheckResult.NOT_MERGED, SvnMergeInfoCache.MergeCheckResult.MERGED);
}
Aggregations