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


Java SVNWorkspaceRoot.getResourceFor方法代码示例

本文整理汇总了Java中org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot.getResourceFor方法的典型用法代码示例。如果您正苦于以下问题:Java SVNWorkspaceRoot.getResourceFor方法的具体用法?Java SVNWorkspaceRoot.getResourceFor怎么用?Java SVNWorkspaceRoot.getResourceFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot的用法示例。


在下文中一共展示了SVNWorkspaceRoot.getResourceFor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getModifiedResources

import org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot; //导入方法依赖的package包/类
protected IResource[] getModifiedResources(IResource[] resources, IProgressMonitor iProgressMonitor) throws SVNException {
    final List modified = new ArrayList();
    for (int i = 0; i < resources.length; i++) {
		 IResource resource = resources[i];
		 ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
		 
		 // get adds, deletes, updates and property updates.
		 GetStatusCommand command = new GetStatusCommand(svnResource, true, false);
		 command.run(iProgressMonitor);
		 ISVNStatus[] statuses = command.getStatuses();
		 for (int j = 0; j < statuses.length; j++) {
		     if (SVNStatusUtils.isReadyForRevert(statuses[j]) ||
		   		  !SVNStatusUtils.isManaged(statuses[j])) {
		         IResource currentResource = SVNWorkspaceRoot.getResourceFor(resource, statuses[j]);
		         if (currentResource != null)
		             modified.add(currentResource);
		     }
		 }
	}
    return (IResource[]) modified.toArray(new IResource[modified.size()]);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:22,代码来源:WorkspaceAction.java

示例2: getUnadded

import org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot; //导入方法依赖的package包/类
private void getUnadded(ISVNClientAdapter client, ISVNLocalResource resource, File file) throws SVNClientException, SVNException {
	ISVNStatus[] statuses = client.getStatus(file, true, true);
	for (ISVNStatus status : statuses) {
		IResource currentResource = SVNWorkspaceRoot.getResourceFor(resource.getResource(), status);
		if (currentResource != null) {
			ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor(currentResource);
			if (!localResource.isIgnored()) {
				if (!SVNStatusUtils.isManaged(status)) {
					if (!isSymLink(currentResource)) {
	                 	if (currentResource.getType() != IResource.FILE) {
	                 		unversionedFolders.add(currentResource);
						} else {
	             			if (addToUnadded(currentResource)) unaddedList.add(currentResource);
						}
					}
				}
			}
		}
	}
	IResource[] unaddedResources = getUnaddedResources(unversionedFolders);
	for (IResource unaddedResource : unaddedResources) {
		unaddedList.add(unaddedResource);
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:25,代码来源:SVNLocalCompareInput.java

示例3: updateCache

import org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot; //导入方法依赖的package包/类
/**
  * update the cache using the given statuses
  * @param statuses
* @param rule the scheduling rule to use when running this operation
  */
 protected List<IResource> updateCache(IResource parent, final ISVNStatus[] statuses) throws CoreException {
 	final List<IResource> result = new ArrayList<IResource>();
 	if (statuses != null) {
      for (ISVNStatus status : statuses) {
      	IResource resource = SVNWorkspaceRoot.getResourceFor(parent, status);
      	result.add(updateCache(resource, status));
      }
 	}
     return result;
 }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:16,代码来源:StatusCacheManager.java

示例4: findChanges

import org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot; //导入方法依赖的package包/类
private IResource[] findChanges(IResource resource, int depth, IProgressMonitor monitor) throws TeamException {
        try {
        	monitor.beginTask("", 100);

        	remoteSyncStateStore.flushBytes(resource, depth);

//            ISVNClientAdapter client = SVNProviderPlugin.getPlugin().createSVNClient();
        	
            boolean descend = (depth == IResource.DEPTH_INFINITE)? true : false;
            boolean showOutOfDate = SVNProviderPlugin.getPlugin().getPluginPreferences().getBoolean(ISVNCoreConstants.PREF_SHOW_OUT_OF_DATE_FOLDERS);
            StatusAndInfoCommand cmd = new StatusAndInfoCommand(SVNWorkspaceRoot.getSVNResourceFor( resource ), descend, showOutOfDate, true );
            cmd.setCallback(new CancelableSVNStatusCallback(monitor));
            cmd.run(monitor);
            
            if (monitor.isCanceled()) {
            	return new IResource[0];
            }
            
            monitor.worked(70);

            RemoteResourceStatus[] statuses = cmd.getRemoteResourceStatuses();

            List<IResource> result = new ArrayList<IResource>(statuses.length);
            for (RemoteResourceStatus status : statuses) {
            	IResource changedResource = SVNWorkspaceRoot.getResourceFor(resource, status);

                if (changedResource == null)
                	continue;

                if (isSupervised(changedResource) || (status.getTextStatus() != SVNStatusKind.NONE))
                {
                	if (!ignoreHiddenChanges || !Util.isHidden(changedResource)) {
	                	result.add(changedResource);
	                	remoteSyncStateStore.setBytes( changedResource, status.getBytes() );
	                	registerChangedResourceParent(changedResource);
                	}
                }
			}
        	// Ensure that the local sync state is also updated
            IContainer container = resource.getType() == IResource.FILE ? resource.getParent() : (IContainer)resource;
        	SVNProviderPlugin.getPlugin().getStatusCacheManager().refreshStatus(container, true);

            monitor.worked(30);            
            return (IResource[]) result.toArray(new IResource[result.size()]);
        } catch (SVNException e) {
        	if (e.getMessage().contains("Operation cancelled")) {
        		return new IResource[0];
        	}
        	else {
        		throw new TeamException("Error getting status for resource " + resource + " " + e.getMessage(), e);
        	}
        } finally {
        	monitor.done();
		}
    }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:56,代码来源:SVNWorkspaceSubscriber.java

示例5: getModifiedResources

import org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot; //导入方法依赖的package包/类
protected IResource[] getModifiedResources(IResource[] resources, IProgressMonitor iProgressMonitor) throws SVNException {
    final List modified = new ArrayList();
    List unversionedFolders = new ArrayList();
    for (int i = 0; i < resources.length; i++) {
		 IResource resource = resources[i];
		 ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
		 
		 // This check is for when the action is called with unmanaged resources
		 if (svnResource.getRepository() == null) {
			 continue;
		 }
		 
		 // get adds, deletes, updates and property updates.
		 GetStatusCommand command = new GetStatusCommand(svnResource, true, false);
		 command.run(iProgressMonitor);
		 ISVNStatus[] statuses = command.getStatuses();
		 for (int j = 0; j < statuses.length; j++) {
		     if (SVNStatusUtils.isReadyForCommit(statuses[j]) || SVNStatusUtils.isMissing(statuses[j])) {
		         IResource currentResource = SVNWorkspaceRoot.getResourceFor(resource, statuses[j]);
		         if (currentResource != null) {
		             ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor(currentResource);
		             if (!localResource.isIgnored()) {
		                 if (!SVNStatusUtils.isManaged(statuses[j])) {
		                	if (!isSymLink(currentResource)) {
			                 	if (currentResource.getType() != IResource.FILE)
			                 		unversionedFolders.add(currentResource);
			                 	else
			                 		if (!modified.contains(currentResource)) {
			                 			modified.add(currentResource);
			                 			if (currentResource instanceof IContainer) statusMap.put(currentResource, statuses[j].getPropStatus());
			                 			else statusMap.put(currentResource, statuses[j].getTextStatus());
			                 			if (addToUnadded(currentResource)) unaddedList.add(currentResource);
			                 		}
		                	}
		                 } else
		                	 if (!modified.contains(currentResource)) {
		                		 modified.add(currentResource);
		                 		 if (currentResource instanceof IContainer) statusMap.put(currentResource, statuses[j].getPropStatus());
		                 		 else statusMap.put(currentResource, statuses[j].getTextStatus());
		                	 }
		             }
		         }
		     }
		 }
    }
    // get unadded resources and add them to the list.
    IResource[] unaddedResources = getUnaddedResources(unversionedFolders, iProgressMonitor);
    for (int i = 0; i < unaddedResources.length; i++) {
    	if (!modified.contains(unaddedResources[i])) {
    		if (unaddedResources[i].getType() == IResource.FILE) {
    			modified.add(unaddedResources[i]);
    			statusMap.put(unaddedResources[i], SVNStatusKind.UNVERSIONED);
    		}
    		if (addToUnadded(unaddedResources[i])) unaddedList.add(unaddedResources[i]);
    	}
    }
    return (IResource[]) modified.toArray(new IResource[modified.size()]);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:59,代码来源:GenerateDiffFileAction.java


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