use of com.intellij.openapi.vcs.changes.ChangeListManagerImpl in project intellij-community by JetBrains.
the class ChangelistConflictDialog method createLeftSideActions.
@NotNull
@Override
protected Action[] createLeftSideActions() {
return new Action[] { new AbstractAction("&Configure...") {
public void actionPerformed(ActionEvent e) {
ChangeListManagerImpl manager = (ChangeListManagerImpl) ChangeListManager.getInstance(myProject);
ShowSettingsUtil.getInstance().editConfigurable(myPanel, new ChangelistConflictConfigurable(manager));
}
} };
}
use of com.intellij.openapi.vcs.changes.ChangeListManagerImpl in project intellij-community by JetBrains.
the class VcsAwareFormatChangedTextUtil method isChangeNotTrackedForFile.
@Override
public boolean isChangeNotTrackedForFile(@NotNull Project project, @NotNull PsiFile file) {
boolean isUnderVcs = VcsUtil.isFileUnderVcs(project, VcsUtil.getFilePath(file.getVirtualFile()));
if (!isUnderVcs)
return true;
ChangeListManagerImpl changeListManager = ChangeListManagerImpl.getInstanceImpl(project);
List<VirtualFile> unversionedFiles = changeListManager.getUnversionedFiles();
if (unversionedFiles.contains(file.getVirtualFile())) {
return true;
}
return false;
}
use of com.intellij.openapi.vcs.changes.ChangeListManagerImpl in project intellij-community by JetBrains.
the class SvnResolveTreeAcceptVariantsTest method testMineFull.
@Test
public void testMineFull() throws Exception {
int cnt = 0;
myWorkingCopyDir = createDirInCommand(myWorkingCopyDir, "test--");
myTheirs = createDirInCommand(myTheirs, "theirs--");
//final TreeConflictData.Data data = TreeConflictData.FileToFile.MINE_EDIT_THEIRS_MOVE;
for (final TreeConflictData.Data data : TreeConflictData.ourAll) {
if (myTraceClient) {
System.out.println("========= TEST " + getTestName(data) + " =========");
}
((ChangeListManagerImpl) myChangeListManager).stopEveryThingIfInTestMode();
myWorkingCopyDir = createDirInCommand(myWorkingCopyDir.getParent(), "test" + cnt);
myTheirs = createDirInCommand(myTheirs.getParent(), "theirs" + cnt);
mySvnClientRunner.checkout(myRepoUrl, myTheirs);
mySvnClientRunner.checkout(myRepoUrl, myWorkingCopyDir);
sleep(200);
ProjectLevelVcsManager.getInstance(myProject).setDirectoryMappings(Collections.singletonList(new VcsDirectoryMapping(myWorkingCopyDir.getPath(), myVcs.getName())));
createSubTree(data);
myTheirs.refresh(false, true);
final ConflictCreator creator = new ConflictCreator(myProject, myTheirs, myWorkingCopyDir, data, mySvnClientRunner);
creator.create();
sleep(200);
((ChangeListManagerImpl) myChangeListManager).forceGoInTestMode();
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final String conflictFile = data.getConflictFile();
final File conflictIoFile = new File(myWorkingCopyDir.getPath(), conflictFile);
final FilePath filePath = VcsUtil.getFilePath(conflictIoFile);
final Change change = myChangeListManager.getChange(filePath);
Assert.assertNotNull(change);
Assert.assertTrue(change instanceof ConflictedSvnChange);
final SvnRevisionNumber committedRevision = change.getBeforeRevision() != null ? (SvnRevisionNumber) change.getBeforeRevision().getRevisionNumber() : null;
//SvnRevisionNumber committedRevision = new SvnRevisionNumber(SVNRevision.create(cnt * 2 + 1));
final SvnTreeConflictResolver resolver = new SvnTreeConflictResolver(myVcs, filePath, null);
resolver.resolveSelectMineFull();
myTheirs.refresh(false, true);
myWorkingCopyDir.refresh(false, true);
checkStatusesAfterMineFullResolve(data, conflictIoFile);
checkFileContents(data, conflictIoFile);
++cnt;
}
}
use of com.intellij.openapi.vcs.changes.ChangeListManagerImpl in project intellij-community by JetBrains.
the class SvnChangesCorrectlyRefreshedTest method testModificationAndAfterRevert.
@Test
public void testModificationAndAfterRevert() throws Exception {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
sleep(100);
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new content");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new content", text1.toString());
sleep(100);
LocalFileSystem.getInstance().refreshAndFindFileByIoFile(virtualToIoFile(subTree.myS1File));
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
final VcsException updateException = ((ChangeListManagerImpl) clManager).getUpdateException();
if (updateException != null) {
updateException.printStackTrace();
}
if (!RepeatSvnActionThroughBusy.ourBusyExceptionProcessor.process(updateException)) {
Assert.assertNull(updateException == null ? null : updateException.getMessage(), updateException);
}
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] { subTree.myS1File }, clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
final CharSequence text = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals(SubTree.ourS1Contents, text.toString());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VirtualFile.EMPTY_ARRAY, clManager.getDefaultListName(), clManager);
}
Aggregations