use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class AssociateWithTaskAction method setSelected.
@Override
public void setSelected(AnActionEvent e, boolean state) {
ChangeList[] lists = e.getData(VcsDataKeys.CHANGE_LISTS);
if (lists == null) {
return;
}
Project project = e.getData(CommonDataKeys.PROJECT);
TaskManager manager = TaskManager.getManager(project);
for (ChangeList list : lists) {
if (list instanceof LocalChangeList) {
manager.trackContext((LocalChangeList) list);
}
}
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class AssociateWithTaskAction method isSelected.
@Override
public boolean isSelected(AnActionEvent e) {
ChangeList[] lists = e.getData(VcsDataKeys.CHANGE_LISTS);
if (lists == null) {
return false;
}
Project project = e.getData(CommonDataKeys.PROJECT);
TaskManager manager = TaskManager.getManager(project);
for (ChangeList list : lists) {
if (list instanceof LocalChangeList && manager.getAssociatedTask((LocalChangeList) list) == null) {
return false;
}
}
return true;
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class EditTaskDialog method doOKAction.
@Override
protected void doOKAction() {
myTask.setSummary(mySummary.getText());
if (myChangelist.isVisible()) {
List<ChangeListInfo> changeLists = myTask.getChangeLists();
changeLists.clear();
LocalChangeList item = (LocalChangeList) myChangelist.getSelectedItem();
if (item != null) {
changeLists.add(new ChangeListInfo(item));
}
}
if (myBranch.isVisible()) {
List<BranchInfo> branches = myTask.getBranches();
branches.clear();
VcsTaskHandler.TaskInfo branch = (VcsTaskHandler.TaskInfo) myBranch.getSelectedItem();
if (branch != null) {
List<BranchInfo> infos = BranchInfo.fromTaskInfo(branch, false);
branches.addAll(infos);
}
}
close(OK_EXIT_CODE);
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testDoubleMove.
@Test
public void testDoubleMove() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList target = changeListManager.addChangeList("target", null);
final LocalChangeList target2 = changeListManager.addChangeList("target2", null);
changeListManager.moveChangesTo(list, new Change[] { changeListManager.getChange(file) });
myScheme.doTest(() -> {
changeListManager.moveChangesTo(target, new Change[] { changeListManager.getChange(file) });
checkFilesAreInList(new VirtualFile[] { file }, target.getName(), changeListManager);
changeListManager.moveChangesTo(target2, new Change[] { changeListManager.getChange(file) });
checkFilesAreInList(new VirtualFile[] { file }, target2.getName(), changeListManager);
});
checkFilesAreInList(new VirtualFile[] { file }, target2.getName(), changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] { file }, target2.getName(), changeListManager);
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testMove.
@Test
public void testMove() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList target = changeListManager.addChangeList("target", null);
changeListManager.moveChangesTo(list, new Change[] { changeListManager.getChange(file) });
myScheme.doTest(() -> {
changeListManager.moveChangesTo(target, new Change[] { changeListManager.getChange(file) });
checkFilesAreInList(new VirtualFile[] { file }, target.getName(), changeListManager);
});
checkFilesAreInList(new VirtualFile[] { file }, target.getName(), changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] { file }, target.getName(), changeListManager);
}
Aggregations