use of org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation in project subclipse by subclipse.
the class RelocateWizard method performFinish.
public boolean performFinish() {
ISVNClientAdapter client = null;
try {
SVNRepositoryLocation newRepository = SVNRepositoryLocation.fromString(urlPage.getNewUrl());
newRepository.setUsername(repository.getUsername());
newRepository.setLabel(repository.getLabel());
newRepository.validateConnection(new NullProgressMonitor());
client = repository.getSVNClient();
for (int i = 0; i < sharedProjects.length; i++) {
client.relocate(repository.getUrl().toString(), newRepository.getUrl().toString(), sharedProjects[i].getLocation().toString(), true);
}
SVNRepositories repositories = SVNProviderPlugin.getPlugin().getRepositories();
repositories.addOrUpdateRepository(newRepository);
for (int i = 0; i < sharedProjects.length; i++) {
SVNProviderPlugin.getPlugin().getStatusCacheManager().refreshStatus(sharedProjects[i], true);
sharedProjects[i].refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
RepositoryProvider provider = RepositoryProvider.getProvider(sharedProjects[i], SVNProviderPlugin.getTypeId());
provider.setProject(sharedProjects[i]);
}
repositories.disposeRepository(repository);
} catch (Exception e) {
MessageDialog.openError(getShell(), Policy.bind("RelocateWizard.heading"), // $NON-NLS-1$
e.getMessage());
return false;
} finally {
repository.returnSVNClient(client);
}
return true;
}
use of org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation in project subclipse by subclipse.
the class RelocateAction method execute.
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
Iterator iter = selection.iterator();
while (iter.hasNext()) {
Object object = iter.next();
if (object instanceof SVNRepositoryLocation) {
SVNRepositoryLocation repository = (SVNRepositoryLocation) object;
RelocateWizard wizard = new RelocateWizard(repository);
WizardDialog dialog = new ClosableWizardDialog(shell, wizard);
dialog.open();
break;
}
}
}
Aggregations