use of org.jetbrains.idea.svn.history.SvnRepositoryLocation in project intellij-community by JetBrains.
the class SvnCommittedViewTest method testAdd.
@Test
public void testAdd() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
final VirtualFile d1 = createDirInCommand(myWorkingCopyDir, "d1");
final VirtualFile f11 = createFileInCommand(d1, "f11.txt", "123\n456");
final VirtualFile f12 = createFileInCommand(d1, "f12.txt", "----");
// r1, addition without history
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, 1, new Data[] { new Data(absPath(f11), FileStatus.ADDED, null), new Data(absPath(f12), FileStatus.ADDED, null), new Data(absPath(d1), FileStatus.ADDED, null) });
}
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();
final String d1Path = virtualToIoFile(d1).getAbsolutePath();
runInAndVerifyIgnoreOutput("delete", d1Path);
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") });
}
use of org.jetbrains.idea.svn.history.SvnRepositoryLocation 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.SvnRepositoryLocation in project intellij-community by JetBrains.
the class SvnCommittedViewTest method testDelete.
@Test
public void testDelete() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
final VirtualFile d1 = createDirInCommand(myWorkingCopyDir, "d1");
final VirtualFile f11 = createFileInCommand(d1, "f11.txt", "123\n456");
final VirtualFile f12 = createFileInCommand(d1, "f12.txt", "----");
// r1, addition without history
checkin();
deleteFileInCommand(f11);
checkin();
update();
deleteFileInCommand(d1);
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(f11), FileStatus.DELETED, null) });
checkList(changeListList, 3, new Data[] { new Data(absPath(d1), FileStatus.DELETED, null) });
}
use of org.jetbrains.idea.svn.history.SvnRepositoryLocation in project intellij-community by JetBrains.
the class MergeFromTheirsResolver method loadSvnChangeListsForPatch.
@NotNull
private List<SvnChangeList> loadSvnChangeListsForPatch(@NotNull TreeConflictDescription description) throws VcsException {
long max = description.getSourceRightVersion().getPegRevision();
long min = description.getSourceLeftVersion().getPegRevision();
SvnRepositoryLocation location = new SvnRepositoryLocation(description.getSourceRightVersion().getRepositoryRoot().toString());
ChangeBrowserSettings settings = new ChangeBrowserSettings();
settings.USE_CHANGE_BEFORE_FILTER = settings.USE_CHANGE_AFTER_FILTER = true;
settings.CHANGE_BEFORE = String.valueOf(max);
settings.CHANGE_AFTER = String.valueOf(min);
//noinspection unchecked
List<SvnChangeList> committedChanges = notNull(myVcs.getCachingCommittedChangesProvider()).getCommittedChanges(settings, location, 0);
return filter(committedChanges, changeList -> changeList.getNumber() != min);
}
Aggregations