Search in sources :

Example 1 with SVNRepositoryLocation

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;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) SVNRepositories(org.tigris.subversion.subclipse.core.repo.SVNRepositories) SVNRepositoryLocation(org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation) RepositoryProvider(org.eclipse.team.core.RepositoryProvider) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Example 2 with SVNRepositoryLocation

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;
        }
    }
}
Also used : RelocateWizard(org.tigris.subversion.subclipse.ui.wizards.RelocateWizard) Iterator(java.util.Iterator) SVNRepositoryLocation(org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog)

Aggregations

SVNRepositoryLocation (org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation)2 Iterator (java.util.Iterator)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 RepositoryProvider (org.eclipse.team.core.RepositoryProvider)1 SVNRepositories (org.tigris.subversion.subclipse.core.repo.SVNRepositories)1 ClosableWizardDialog (org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog)1 RelocateWizard (org.tigris.subversion.subclipse.ui.wizards.RelocateWizard)1 ISVNClientAdapter (org.tigris.subversion.svnclientadapter.ISVNClientAdapter)1