use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testEditComment.
@Test
public void testEditComment() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final String listName = "test";
final LocalChangeList list = changeListManager.addChangeList(listName, null);
changeListManager.moveChangesTo(list, new Change[] { changeListManager.getChange(file) });
final String finalText = "final text";
myScheme.doTest(() -> {
final String intermediate = "intermediate text";
changeListManager.editComment(list.getName(), intermediate);
assert changeListManager.findChangeList(listName) != null;
LocalChangeList list1 = changeListManager.findChangeList(listName);
assert intermediate.equals(list1.getComment());
changeListManager.editComment(list1.getName(), finalText);
list1 = changeListManager.findChangeList(listName);
assert finalText.equals(list1.getComment());
});
LocalChangeList changedList = changeListManager.findChangeList(listName);
assert finalText.equals(changedList.getComment());
changeListManager.ensureUpToDate(false);
changedList = changeListManager.findChangeList(listName);
assert finalText.equals(changedList.getComment());
}
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);
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testSetActive.
@Test
public void testSetActive() 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.setDefaultChangeList(target);
assert changeListManager.getDefaultChangeList().getName().equals(target.getName());
});
assert changeListManager.getDefaultChangeList().getName().equals(target.getName());
changeListManager.ensureUpToDate(false);
assert changeListManager.getDefaultChangeList().getName().equals(target.getName());
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class AddChangeListAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
NewChangelistDialog dlg = new NewChangelistDialog(project);
dlg.show();
if (dlg.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
String name = dlg.getName();
if (name.length() == 0) {
name = getUniqueName(project);
}
final LocalChangeList list = ChangeListManager.getInstance(project).addChangeList(name, dlg.getDescription());
if (dlg.isNewChangelistActive()) {
ChangeListManager.getInstance(project).setDefaultChangeList(list);
}
dlg.getPanel().changelistCreatedOrChanged(list);
}
}
use of com.intellij.openapi.vcs.changes.LocalChangeList in project intellij-community by JetBrains.
the class ChangeListChooserPanel method updateDescription.
private void updateDescription() {
LocalChangeList list = getExistingChangelistByName(myListPanel.getChangeListName());
String newText = list != null ? list.getComment() : myLastTypedDescription;
if (!StringUtil.equals(myListPanel.getDescription(), newText)) {
myListPanel.setDescription(newText);
}
}
Aggregations