use of com.intellij.openapi.vcs.update.CommonUpdateProjectAction in project intellij-community by JetBrains.
the class SvnTestCase method imitUpdate.
protected static void imitUpdate(final Project project) {
ProjectLevelVcsManagerEx.getInstanceEx(project).getOptions(VcsConfiguration.StandardOption.UPDATE).setValue(false);
final CommonUpdateProjectAction action = new CommonUpdateProjectAction();
action.getTemplatePresentation().setText("1");
action.actionPerformed(new AnActionEvent(null, dataId -> {
if (CommonDataKeys.PROJECT.is(dataId)) {
return project;
}
return null;
}, "test", new Presentation(), ActionManager.getInstance(), 0));
final ChangeListManager clManager = ChangeListManager.getInstance(project);
clManager.ensureUpToDate(false);
// wait for after-events like annotations recalculation
clManager.ensureUpToDate(false);
// zipper updater
sleep(100);
}
use of com.intellij.openapi.vcs.update.CommonUpdateProjectAction in project intellij-community by JetBrains.
the class SvnAnnotationIsClosedTest method testClosedChangedByUpdateInIdea.
@Test
public void testClosedChangedByUpdateInIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
//#1
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
//#2
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
//#3
checkin();
// take #2
runInAndVerifyIgnoreOutput("up", "-r", "2");
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
annotation.setCloser(() -> {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
});
listener.registerAnnotation(tree.myS1File, annotation);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertFalse(myIsClosed);
ProjectLevelVcsManagerEx.getInstanceEx(myProject).getOptions(VcsConfiguration.StandardOption.UPDATE).setValue(false);
final CommonUpdateProjectAction action = new CommonUpdateProjectAction();
action.getTemplatePresentation().setText("1");
action.actionPerformed(new AnActionEvent(null, dataId -> {
if (CommonDataKeys.PROJECT.is(dataId)) {
return myProject;
}
return null;
}, "test", new Presentation(), ActionManager.getInstance(), 0));
myChangeListManager.ensureUpToDate(false);
// wait for after-events like annotations recalculation
myChangeListManager.ensureUpToDate(false);
// zipper updater
sleep(100);
Assert.assertTrue(myIsClosed);
}
use of com.intellij.openapi.vcs.update.CommonUpdateProjectAction in project intellij-community by JetBrains.
the class SvnAnnotationIsClosedTest method testClosedByUpdateInIdea.
@Test
public void testClosedByUpdateInIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
//#1
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
//#2
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
//#3
checkin();
runInAndVerifyIgnoreOutput("up", "-r", "2");
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
annotation.setCloser(() -> {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
});
listener.registerAnnotation(tree.myS1File, annotation);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
ProjectLevelVcsManagerEx.getInstanceEx(myProject).getOptions(VcsConfiguration.StandardOption.UPDATE).setValue(false);
final CommonUpdateProjectAction action = new CommonUpdateProjectAction();
action.getTemplatePresentation().setText("1");
action.actionPerformed(new AnActionEvent(null, dataId -> {
if (CommonDataKeys.PROJECT.is(dataId)) {
return myProject;
}
return null;
}, "test", new Presentation(), ActionManager.getInstance(), 0));
myChangeListManager.ensureUpToDate(false);
// wait for after-events like annotations recalculation
myChangeListManager.ensureUpToDate(false);
// zipper updater
sleep(100);
Assert.assertTrue(myIsClosed);
}
Aggregations