当前位置: 首页>>代码示例>>Java>>正文


Java SVNRepositories.addOrUpdateRepository方法代码示例

本文整理汇总了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;
  }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:38,代码来源:SVNRepositoryPropertiesPage.java

示例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;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:30,代码来源:RelocateWizard.java


注:本文中的org.tigris.subversion.subclipse.core.repo.SVNRepositories.addOrUpdateRepository方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。