use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class CvsRollbackEnvironment method rollbackMissingFileDeletion.
public void rollbackMissingFileDeletion(List<FilePath> filePaths, final List<VcsException> exceptions, final RollbackProgressListener listener) {
final CvsHandler cvsHandler = CommandCvsHandler.createCheckoutFileHandler(filePaths.toArray(new FilePath[filePaths.size()]), CvsConfiguration.getInstance(myProject), null);
final CvsOperationExecutor executor = new CvsOperationExecutor(myProject);
executor.performActionSync(cvsHandler, CvsOperationExecutorCallback.EMPTY);
}
use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class CheckoutAction method getCvsHandler.
protected CvsHandler getCvsHandler(CvsContext context) {
final Project project = context.getProject();
CheckoutWizard checkoutWizard = new CheckoutWizard(project);
if (!checkoutWizard.showAndGet()) {
return CvsHandler.NULL;
}
myUseAlternativeCheckoutPath = checkoutWizard.useAlternativeCheckoutLocation();
myCheckoutDirectory = checkoutWizard.getCheckoutDirectory();
mySelectedElements = checkoutWizard.getSelectedElements();
return CommandCvsHandler.createCheckoutHandler(checkoutWizard.getSelectedConfiguration(), collectCheckoutPaths(), myCheckoutDirectory, myUseAlternativeCheckoutPath, CvsApplicationLevelConfiguration.getInstance().MAKE_CHECKED_OUT_FILES_READONLY, project == null ? null : VcsConfiguration.getInstance(project).getCheckoutOption());
}
use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class CvsCheckoutProvider method doCheckout.
public void doCheckout(@NotNull final Project project, final CheckoutProvider.Listener listener) {
final CheckoutWizard checkoutWizard = new CheckoutWizard(project);
if (!checkoutWizard.showAndGet()) {
return;
}
final boolean useAlternateCheckoutPath = checkoutWizard.useAlternativeCheckoutLocation();
final File checkoutDirectory = checkoutWizard.getCheckoutDirectory();
final CvsElement[] selectedElements = checkoutWizard.getSelectedElements();
final CvsHandler checkoutHandler = CommandCvsHandler.createCheckoutHandler(checkoutWizard.getConfigurationWithDateOrRevisionSettings(), collectCheckoutPaths(selectedElements), checkoutDirectory, useAlternateCheckoutPath, CvsApplicationLevelConfiguration.getInstance().MAKE_CHECKED_OUT_FILES_READONLY, VcsConfiguration.getInstance(project).getCheckoutOption());
final CvsOperationExecutor executor = new CvsOperationExecutor(null);
executor.performActionSync(checkoutHandler, new CvsOperationExecutorCallback() {
public void executionFinished(boolean successfully) {
if (!executor.hasNoErrors()) {
Messages.showErrorDialog(CvsBundle.message("message.error.checkout", executor.getResult().composeError().getLocalizedMessage()), CvsBundle.message("operation.name.check.out.project"));
}
refreshAfterCheckout(listener, selectedElements, checkoutDirectory, useAlternateCheckoutPath);
}
public void executionFinishedSuccessfully() {
}
public void executeInProgressAfterAction(ModalityContext modaityContext) {
}
});
}
use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class ViewWatchersAction method onActionPerformed.
protected void onActionPerformed(CvsContext context, CvsTabbedWindow tabbedWindow, boolean successfully, CvsHandler handler) {
super.onActionPerformed(context, tabbedWindow, successfully, handler);
if (successfully) {
List<WatcherInfo> watchers = myWatchersOperation.getWatchers();
String filePath = CvsVfsUtil.getFileFor(context.getSelectedFile()).getAbsolutePath();
final Project project = context.getProject();
if (project == null) {
return;
}
if (watchers.isEmpty()) {
VcsBalloonProblemNotifier.showOverChangesView(project, CvsBundle.message("message.error.no.watchers.for.file", filePath), MessageType.INFO);
} else {
tabbedWindow.addTab(CvsBundle.message("message.watchers.for.file", filePath), new WatchersPanel(watchers), true, true, true, true, null, "cvs.watchers");
}
}
}
use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class IgnoreFileAction method refreshFilesAndStatuses.
private static void refreshFilesAndStatuses(final CvsContext context, final MultiMap<VirtualFile, VirtualFile> parentToSelectedChildren) {
final Refreshable refreshablePanel = context.getRefreshableDialog();
if (refreshablePanel != null)
refreshablePanel.saveState();
final int[] refreshedParents = new int[] { 0 };
final Collection<VirtualFile> createdCvsIgnoreFiles = new ArrayList<>();
for (final VirtualFile parent : parentToSelectedChildren.keySet()) {
final Runnable runnable = new Runnable() {
public void run() {
try {
final VirtualFile cvsIgnoreFile = CvsVfsUtil.refreshAndfFindChild(parent, CvsUtil.CVS_IGNORE_FILE);
if (cvsIgnoreFile == null) {
final String path = parent.getPath() + "/" + CvsUtil.CVS_IGNORE_FILE;
LOG.error(String.valueOf(CvsVfsUtil.findFileByPath(path)) + " " + parent.getPath() + " " + new File(VfsUtil.virtualToIoFile(parent), CvsUtil.CVS_IGNORE_FILE).isFile());
return;
}
if (!CvsUtil.fileIsUnderCvs(cvsIgnoreFile) && !ChangeListManager.getInstance(context.getProject()).isIgnoredFile(cvsIgnoreFile) && !CvsEntriesManager.getInstance().fileIsIgnored(cvsIgnoreFile)) {
createdCvsIgnoreFiles.add(cvsIgnoreFile);
}
final Collection<VirtualFile> filesToUpdateStatus = parentToSelectedChildren.get(parent);
for (final VirtualFile file : filesToUpdateStatus) {
FileStatusManager.getInstance(context.getProject()).fileStatusChanged(file);
VcsDirtyScopeManager.getInstance(context.getProject()).fileDirty(file);
}
} finally {
refreshedParents[0]++;
if (refreshedParents[0] == parentToSelectedChildren.size()) {
// all parents are refreshed
if (createdCvsIgnoreFiles.isEmpty()) {
refreshPanel(context);
} else {
addCvsIgnoreFilesToCvsAndRefreshPanel();
}
}
}
}
private void addCvsIgnoreFilesToCvsAndRefreshPanel() {
createAddFilesAction().actionPerformed(createContext(createdCvsIgnoreFiles, context));
}
private AddFileOrDirectoryAction createAddFilesAction() {
return new AddFileOrDirectoryAction(CvsBundle.message("adding.cvsignore.files.to.cvs.action.name"), Options.ON_FILE_ADDING) {
protected void onActionPerformed(CvsContext context, CvsTabbedWindow tabbedWindow, boolean successfully, CvsHandler handler) {
refreshPanel(context);
}
};
}
};
parent.refresh(true, true, runnable);
}
}
Aggregations