use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class MigrateCvsRootAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent event) {
final VcsContext context = CvsContextWrapper.createInstance(event);
final VirtualFile selectedFile = context.getSelectedFile();
final Project project = context.getProject();
final MigrateRootDialog dialog = new MigrateRootDialog(project, selectedFile);
if (!dialog.showAndGet()) {
return;
}
final File directory = dialog.getSelectedDirectory();
final boolean shouldReplaceAllRoots = dialog.shouldReplaceAllRoots();
final List<File> rootFiles = new ArrayList<>();
try {
if (shouldReplaceAllRoots) {
collectRootFiles(directory, null, rootFiles);
} else {
collectRootFiles(directory, dialog.getCvsRoot(), rootFiles);
}
} catch (IOException e) {
LOG.error(e);
return;
}
final CvsRootConfiguration cvsConfiguration = dialog.getSelectedCvsConfiguration();
final String cvsRoot = cvsConfiguration.getCvsRootAsString();
for (final File file : rootFiles) {
try {
FileUtils.writeLine(file, cvsRoot);
} catch (IOException e) {
LOG.error(e);
break;
}
}
final AccessToken token = ApplicationManager.getApplication().acquireReadActionLock();
try {
for (File file : rootFiles) {
CvsVfsUtil.findFileByIoFile(file).refresh(true, false);
}
} finally {
token.finish();
}
StatusBar.Info.set("Finished migrating CVS root to " + cvsRoot, project);
}
use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class CvsEntriesManager method createConnectionSettingsOn.
public CvsConnectionSettings createConnectionSettingsOn(String cvsRoot) {
if (!myStringToSettingsMap.containsKey(cvsRoot)) {
final CvsRootConfiguration rootConfiguration = myApplicationLevelConfiguration.getConfigurationForCvsRoot(cvsRoot);
CvsConnectionSettings settings = new IDEARootFormatter(rootConfiguration).createConfiguration();
myStringToSettingsMap.put(cvsRoot, settings);
}
return myStringToSettingsMap.get(cvsRoot);
}
use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class SelectCvsConfigurationPanel method fillModel.
private void fillModel(@Nullable CvsRootConfiguration configurationToSelect) {
final CvsRootConfiguration selection = configurationToSelect == null ? mySelection : configurationToSelect;
myModel.removeAllElements();
final List<CvsRootConfiguration> configurations = CvsApplicationLevelConfiguration.getInstance().CONFIGURATIONS;
for (CvsRootConfiguration configuration : configurations) {
if (configuration.CVS_ROOT.isEmpty())
continue;
myModel.addElement(configuration);
}
if (selection != null)
myList.setSelectedValue(selection, true);
if (myList.getSelectedIndex() < 0 && myList.getModel().getSize() > 0) {
myList.setSelectedIndex(0);
}
}
use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class SelectCvsConfigurationPanel method editConfigurations.
public void editConfigurations() {
final CvsApplicationLevelConfiguration configuration = CvsApplicationLevelConfiguration.getInstance();
final CvsConfigurationsListEditor cvsConfigurationsListEditor = new CvsConfigurationsListEditor(new ArrayList<>(configuration.CONFIGURATIONS), myProject);
final CvsRootConfiguration selectedConfiguration = getSelectedConfiguration();
if (selectedConfiguration != null) {
cvsConfigurationsListEditor.selectConfiguration(selectedConfiguration);
}
if (cvsConfigurationsListEditor.showAndGet()) {
configuration.CONFIGURATIONS = cvsConfigurationsListEditor.getConfigurations();
fillModel(cvsConfigurationsListEditor.getSelectedConfiguration());
}
}
use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class CvsServicesImpl method createCvsVersionOn.
private static ComparableVcsRevisionOnOperation createCvsVersionOn(CvsModule module, Project project) {
final CvsRootConfiguration rootConfiguration = CvsApplicationLevelConfiguration.getInstance().getConfigurationForCvsRoot(module.getRepository().getStringRepresentation());
CvsConnectionSettings env = new IDEARootFormatter(rootConfiguration).createConfiguration();
GetFileContentOperation operation = new GetFileContentOperation(new File(module.getPathInCvs()), env, new SimpleRevision(module.getRevision()));
return new ComparableVcsRevisionOnOperation(operation, project);
}
Aggregations