本文整理汇总了Java中org.tigris.subversion.subclipse.core.repo.SVNRepositories.addOrUpdateRepository方法的典型用法代码示例。如果您正苦于以下问题:Java SVNRepositories.addOrUpdateRepository方法的具体用法?Java SVNRepositories.addOrUpdateRepository怎么用?Java SVNRepositories.addOrUpdateRepository使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tigris.subversion.subclipse.core.repo.SVNRepositories
的用法示例。
在下文中一共展示了SVNRepositories.addOrUpdateRepository方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performOk
import org.tigris.subversion.subclipse.core.repo.SVNRepositories; //导入方法依赖的package包/类
public boolean performOk() {
if (showCredentials) {
if (passwordChanged) {
location.setPassword(passwordText.getText());
passwordChanged = false;
}
location.setUsername(loginText.getText());
}
if (useCustomLabelButton.getSelection()) {
location.setLabel(customLabelText.getText());
} else {
location.setLabel(null);
}
if (!repositoryRootText.getText().equals("")) { //$NON-NLS-1$
try {
location.setRepositoryRoot(new SVNUrl(repositoryRootText.getText()));
} catch (MalformedURLException e1) {
// should not occur, we don't change the url of the root
}
} else {
location.setRepositoryRoot(null);
}
try {
SVNRepositories repositories = SVNProviderPlugin.getPlugin().getRepositories();
repositories.addOrUpdateRepository(location);
SVNLightweightDecorator.refresh();
} catch (SVNException e) {
handle(e);
return false;
}
return true;
}
示例2: performFinish
import org.tigris.subversion.subclipse.core.repo.SVNRepositories; //导入方法依赖的package包/类
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"), e.getMessage()); //$NON-NLS-1$
return false;
}
finally {
repository.returnSVNClient(client);
}
return true;
}