use of org.jetbrains.idea.svn.history.SvnChangeList in project intellij-community by JetBrains.
the class SvnCommittedViewTest method checkList.
protected void checkList(final List<SvnChangeList> lists, final long revision, final Data[] content) throws Exception {
SvnChangeList list = null;
for (SvnChangeList changeList : lists) {
if (changeList.getNumber() == revision) {
list = changeList;
}
}
Assert.assertNotNull("Change list #" + revision + " not found.", list);
final Collection<Change> changes = new ArrayList<>(list.getChanges());
Assert.assertNotNull("Null changes list", changes);
Assert.assertEquals(changes.size(), content.length);
for (Data data : content) {
boolean found = false;
for (Change change : changes) {
if (data.shouldBeComparedWithChange(change)) {
Assert.assertTrue(Comparing.equal(data.myOriginText, change.getOriginText(myProject)));
Assert.assertEquals(data.myStatus, change.getFileStatus());
found = true;
break;
}
}
Assert.assertTrue(printChanges(data, changes), found);
}
}
use of org.jetbrains.idea.svn.history.SvnChangeList in project intellij-community by JetBrains.
the class SvnCommittedViewTest method testMoveDirChangeFile.
@Test
public void testMoveDirChangeFile() 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);
final String oldF11Path = virtualToIoFile(f11).getAbsolutePath();
moveFileInCommand(d1, d2);
VcsTestUtil.editFileInCommand(myProject, f11, "new");
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"), new Data(absPath(f11), FileStatus.MODIFIED, "- moved from " + oldF11Path) });
}
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 assertMergeResult.
private void assertMergeResult(@NotNull List<SvnChangeList> changeLists, @NotNull SvnMergeInfoCache.MergeCheckResult... mergeResults) throws VcsException {
myOneShotMergeInfoHelper.prepare();
for (int i = 0; i < mergeResults.length; i++) {
SvnChangeList changeList = changeLists.get(i);
assertMergeResult(changeList, mergeResults[i]);
assertMergeResultOneShot(changeList, mergeResults[i]);
}
}
Aggregations