protected void updateChangeListManager() { ChangeListManager changeListManager = ChangeListManager.getInstance(myProject); VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty(); changeListManager.ensureUpToDate(false); }
public void run() { if (project.isOpen() && (!project.isDisposed()) && (!project.isDefault())) { final VcsDirtyScopeManager mgr = VcsDirtyScopeManager.getInstance(project); mgr.fileDirty(virtualBaseDirectory); } } });
return P4ServerComponent .perform(project, entity.first, new AddEditAction(path, null, p4cl, path.getCharset(project))) .whenCompleted((r) -> VcsDirtyScopeManager.getInstance(project).filesDirty(Collections.singleton(file), null)) .whenServerError((err) -> exceptions.add(new VcsException(err)))
/** * Adds a new line of text to a file and adds/commits it * * @param file * @param repository * @param project * @throws IOException * @throws IOException */ public static void editAndCommitFile(final File file, final git4idea.repo.GitRepository repository, final Project project) throws IOException { // edits file final VirtualFile readmeVirtualFile = LocalFileSystem.getInstance().findFileByIoFile(file); FileUtil.writeToFile(file, "\nnew line", true); // adds and commits the change final LocalChangeListImpl localChangeList = LocalChangeListImpl.createEmptyChangeListImpl(project, "TestCommit", "12345"); final ChangeListManagerImpl changeListManager = ChangeListManagerImpl.getInstanceImpl(project); VcsDirtyScopeManager.getInstance(project).markEverythingDirty(); changeListManager.ensureUpToDate(false); changeListManager.addUnversionedFiles(localChangeList, ImmutableList.of(readmeVirtualFile)); final Change change = changeListManager.getChange(LocalFileSystem.getInstance().findFileByIoFile(file)); repository.getVcs().getCheckinEnvironment().commit(ImmutableList.of(change), COMMIT_MESSAGE); }