use of org.jetbrains.idea.svn.ignore.FileGroupInfo in project intellij-community by JetBrains.
the class IgnoreActionGroup method update.
public void update(final AnActionEvent e) {
final FileGroupInfo fileGroupInfo = new FileGroupInfo();
myHelperAction.setFileIterationListener(fileGroupInfo);
myHelperAction.update(e);
myGetterStub.setDelegate(fileGroupInfo);
if ((e.getPresentation().isEnabled())) {
removeAll();
if (myHelperAction.allAreIgnored()) {
final DataContext dataContext = e.getDataContext();
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
SvnVcs vcs = SvnVcs.getInstance(project);
final Ref<Boolean> filesOk = new Ref<>(Boolean.FALSE);
final Ref<Boolean> extensionOk = new Ref<>(Boolean.FALSE);
// virtual files parameter is not used -> can pass null
SvnPropertyService.doCheckIgnoreProperty(vcs, null, fileGroupInfo, fileGroupInfo.getExtensionMask(), filesOk, extensionOk);
if (Boolean.TRUE.equals(filesOk.get())) {
myRemoveExactAction.setActionText(fileGroupInfo.oneFileSelected() ? fileGroupInfo.getFileName() : SvnBundle.message("action.Subversion.UndoIgnore.text"));
add(myRemoveExactAction);
}
if (Boolean.TRUE.equals(extensionOk.get())) {
myRemoveExtensionAction.setActionText(fileGroupInfo.getExtensionMask());
add(myRemoveExtensionAction);
}
e.getPresentation().setText(SvnBundle.message("group.RevertIgnoreChoicesGroup.text"));
} else if (myHelperAction.allCanBeIgnored()) {
final String ignoreExactlyName = (fileGroupInfo.oneFileSelected()) ? fileGroupInfo.getFileName() : SvnBundle.message("action.Subversion.Ignore.ExactMatch.text");
myAddExactAction.setActionText(ignoreExactlyName);
add(myAddExactAction);
if (fileGroupInfo.sameExtension()) {
myAddExtensionAction.setActionText(fileGroupInfo.getExtensionMask());
add(myAddExtensionAction);
}
e.getPresentation().setText(SvnBundle.message("group.IgnoreChoicesGroup.text"));
}
}
}
use of org.jetbrains.idea.svn.ignore.FileGroupInfo in project intellij-community by JetBrains.
the class SvnRollbackTest method testRollbackDirWithCommittedIgnored.
@Test
public void testRollbackDirWithCommittedIgnored() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
VirtualFile ignored = createFileInCommand(tree.mySourceDir, "ign.txt", "ignored");
final File wasIgnored = virtualToIoFile(ignored);
final FileGroupInfo groupInfo = new FileGroupInfo();
groupInfo.onFileEnabled(ignored);
SvnPropertyService.doAddToIgnoreProperty(myVcs, false, new VirtualFile[] { ignored }, groupInfo);
checkin();
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change dirChange = assertRenamedChange(tree.mySourceDir);
final Change s1Change = assertMovedChange(tree.myS1File);
final Change s2Change = assertMovedChange(tree.myS2File);
Assert.assertTrue(!wasIgnored.exists());
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
rollbackIMpl(Collections.singletonList(dirChange), Collections.emptyList());
ignored = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wasIgnored);
// ignored property was not committed
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
Assert.assertTrue(wasIgnored.exists());
}
use of org.jetbrains.idea.svn.ignore.FileGroupInfo in project intellij-community by JetBrains.
the class SvnRollbackTest method testRollbackDirWithCommittedIgnored.
@Test
public void testRollbackDirWithCommittedIgnored() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
VirtualFile ignored = createFileInCommand(tree.mySourceDir, "ign.txt", "ignored");
final File wasIgnored = virtualToIoFile(ignored);
final FileGroupInfo groupInfo = new FileGroupInfo();
groupInfo.onFileEnabled(ignored);
SvnPropertyService.doAddToIgnoreProperty(myVcs, false, new VirtualFile[] { ignored }, groupInfo);
checkin();
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change dirChange = assertRenamedChange(tree.mySourceDir);
final Change s1Change = assertMovedChange(tree.myS1File);
final Change s2Change = assertMovedChange(tree.myS2File);
Assert.assertTrue(!wasIgnored.exists());
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
rollbackIMpl(Collections.singletonList(dirChange), Collections.emptyList());
ignored = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wasIgnored);
// ignored property was not committed
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
Assert.assertTrue(wasIgnored.exists());
}
use of org.jetbrains.idea.svn.ignore.FileGroupInfo in project intellij-community by JetBrains.
the class SvnRollbackTest method testRollbackDirWithIgnored.
@Test
public void testRollbackDirWithIgnored() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
VirtualFile ignored = createFileInCommand(tree.mySourceDir, "ign.txt", "ignored");
final File wasIgnored = virtualToIoFile(ignored);
final FileGroupInfo groupInfo = new FileGroupInfo();
groupInfo.onFileEnabled(ignored);
SvnPropertyService.doAddToIgnoreProperty(myVcs, false, new VirtualFile[] { ignored }, groupInfo);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change dirChange = assertRenamedChange(tree.mySourceDir);
final Change s1Change = assertMovedChange(tree.myS1File);
final Change s2Change = assertMovedChange(tree.myS2File);
Assert.assertTrue(!wasIgnored.exists());
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
rollbackIMpl(Collections.singletonList(dirChange), Collections.emptyList());
ignored = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wasIgnored);
// ignored property was not committed
Assert.assertTrue(FileStatus.UNKNOWN.equals(myChangeListManager.getStatus(ignored)));
Assert.assertTrue(wasIgnored.exists());
}
use of org.jetbrains.idea.svn.ignore.FileGroupInfo in project intellij-community by JetBrains.
the class SvnRollbackTest method testRollbackDirWithIgnored.
@Test
public void testRollbackDirWithIgnored() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
disableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
VirtualFile ignored = createFileInCommand(tree.mySourceDir, "ign.txt", "ignored");
final File wasIgnored = virtualToIoFile(ignored);
final FileGroupInfo groupInfo = new FileGroupInfo();
groupInfo.onFileEnabled(ignored);
SvnPropertyService.doAddToIgnoreProperty(myVcs, false, new VirtualFile[] { ignored }, groupInfo);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
VcsTestUtil.renameFileInCommand(myProject, tree.mySourceDir, "renamed");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change dirChange = assertRenamedChange(tree.mySourceDir);
final Change s1Change = assertMovedChange(tree.myS1File);
final Change s2Change = assertMovedChange(tree.myS2File);
Assert.assertTrue(!wasIgnored.exists());
Assert.assertTrue(FileStatus.IGNORED.equals(myChangeListManager.getStatus(ignored)));
rollbackIMpl(Collections.singletonList(dirChange), Collections.emptyList());
ignored = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(wasIgnored);
// ignored property was not committed
Assert.assertTrue(FileStatus.UNKNOWN.equals(myChangeListManager.getStatus(ignored)));
Assert.assertTrue(wasIgnored.exists());
}
Aggregations