Java Code Examples for org.tigris.subversion.svnclientadapter.SVNStatusKind#NONE

The following examples show how to use org.tigris.subversion.svnclientadapter.SVNStatusKind#NONE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SVNStatusSyncInfo.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private static IResourceVariant createLatestResourceVariant(IResource local, LocalResourceStatus baseStatusInfo, RemoteResourceStatus remoteStatusInfo) {
    if( remoteStatusInfo == null
            || remoteStatusInfo.getStatusKind() == SVNStatusKind.DELETED )
        return null;
    if( remoteStatusInfo.getStatusKind() == SVNStatusKind.NONE && 
        baseStatusInfo != null && isAddition(baseStatusInfo.getStatusKind()) ) {
        return null;
    }

    if( local.getType() == IResource.FILE ) {
        return new RemoteFile(remoteStatusInfo);
    }
    else {
        return new RemoteFolder(remoteStatusInfo);
    }
}
 
Example 2
Source File: JhlConverter.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public static SVNStatusKind convertStatusKind(Status.Kind kind) {
	if (kind == null) {
		return null;
	}
    switch (kind) {
        case none :
            return SVNStatusKind.NONE;
        case normal :
            return SVNStatusKind.NORMAL;                
        case added :
            return SVNStatusKind.ADDED;
        case missing :
            return SVNStatusKind.MISSING;
        case incomplete :
            return SVNStatusKind.INCOMPLETE;
        case deleted :
            return SVNStatusKind.DELETED;
        case replaced :
            return SVNStatusKind.REPLACED;                                                
        case modified :
            return SVNStatusKind.MODIFIED;
        case merged :
            return SVNStatusKind.MERGED;                
        case conflicted :
            return SVNStatusKind.CONFLICTED;
        case obstructed :
            return SVNStatusKind.OBSTRUCTED;
        case ignored :
            return SVNStatusKind.IGNORED;  
        case external:
            return SVNStatusKind.EXTERNAL;
        case unversioned :
            return SVNStatusKind.UNVERSIONED;
        default : {
        	log.severe("unknown status kind :"+kind);
            return SVNStatusKind.NONE;
        }
    }
}
 
Example 3
Source File: SVNWorkspaceSubscriber.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
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();
		}
    }
 
Example 4
Source File: SVNStatusSyncInfo.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
protected int calculateKind() throws TeamException {
        SVNStatusKind localKind = baseStatusInfo.getStatusKind();
        SVNStatusKind repositoryKind = (remoteStatusInfo != null)
            								? remoteStatusInfo.getStatusKind() : SVNStatusKind.NORMAL;
        IResource local = getLocal();
        
        if (local.getParent() != null && !local.getParent().exists()) {
        	return SyncInfo.IN_SYNC;
        }
        
        // If resource is ignored through Eclipse project's resource filters property, IResource.exists() returns false,
        // even if the file/folder exists in the file system.  So we need to check for the existence in the file system
        // so that these items aren't incorrectly shown as outgoing deletions.

        if (!local.exists() && !(local.getLocation() == null || local.getLocation().toFile().exists())) {
        	if (isAddition(repositoryKind)) return SyncInfo.INCOMING | SyncInfo.ADDITION;
            if (localKind == SVNStatusKind.UNVERSIONED) return SyncInfo.IN_SYNC;
            if (isDeletion(repositoryKind)) return SyncInfo.IN_SYNC;
            if (!repositoryKind.equals(SVNStatusKind.ADDED)) {        	
            	if (localKind == SVNStatusKind.NONE) {
            		return SyncInfo.IN_SYNC;
            	}
            	
                if (isChange(repositoryKind)) return SyncInfo.CONFLICTING | SyncInfo.DELETION;
                return SyncInfo.OUTGOING | SyncInfo.DELETION;
            } else return SyncInfo.INCOMING | SyncInfo.ADDITION;
        }

        else if ( isDeletion(localKind))
        {
    		if (isNotModified(repositoryKind)) {
    			if (isOutOfDate())
    				return SyncInfo.CONFLICTING | SyncInfo.DELETION;
    			else
    				return SyncInfo.OUTGOING | SyncInfo.DELETION;
    		} else
    			return SyncInfo.CONFLICTING | SyncInfo.DELETION;
        }
        else if( isChange(localKind) ) {
            if( isChange( repositoryKind )
             || isAddition( repositoryKind ) 
             || isDeletion( repositoryKind ))
                return SyncInfo.CONFLICTING | SyncInfo.CHANGE;
            else {
            	if ((IResource.FOLDER == local.getType() || IResource.PROJECT == local.getType()) && isOutOfDate())
            		return SyncInfo.CONFLICTING | SyncInfo.CHANGE;
            	else
            		return SyncInfo.OUTGOING | SyncInfo.CHANGE;
            }
        }
        else if( isAddition( localKind ) ) {
            if( isAddition( repositoryKind ) )
                return SyncInfo.CONFLICTING | SyncInfo.ADDITION;
            return SyncInfo.OUTGOING | SyncInfo.ADDITION;
        }
        else if( isNotModified(localKind) ) {
            if( isNotModified( repositoryKind) ) {
            	if ((IResource.FOLDER == local.getType() || IResource.PROJECT == local.getType()) && isOutOfDate())
            		return SyncInfo.INCOMING | SyncInfo.CHANGE;
                return SyncInfo.IN_SYNC;
            }
            if ((localKind == SVNStatusKind.IGNORED) && (repositoryKind == SVNStatusKind.ADDED))
	                return SyncInfo.CONFLICTING | SyncInfo.ADDITION;
            if( repositoryKind == SVNStatusKind.DELETED )
                return SyncInfo.INCOMING | SyncInfo.DELETION;
            if( repositoryKind == SVNStatusKind.ADDED )
                return SyncInfo.INCOMING | SyncInfo.ADDITION;
            if( repositoryKind == SVNStatusKind.EXTERNAL)
                return SyncInfo.IN_SYNC;
//TODO Is this really necessary here ?
//            if (getComparator().compare(getBase(), getRemote())) 
//                return SyncInfo.IN_SYNC;
            return SyncInfo.INCOMING | SyncInfo.CHANGE;
        }
        else if( repositoryKind == SVNStatusKind.EXTERNAL ) {
            if (localKind == SVNStatusKind.EXTERNAL)
            	return SyncInfo.IN_SYNC;
        }
        else if ((localKind == SVNStatusKind.EXTERNAL) && (remoteStatusInfo == null))
        {
        	return SyncInfo.IN_SYNC;
        }
        
        return super.calculateKind();
    }
 
Example 5
Source File: SVNStatusSyncInfo.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
private boolean isNotModified(SVNStatusKind kind) {
    return kind == SVNStatusKind.NORMAL
          || kind == SVNStatusKind.IGNORED 
          || kind == SVNStatusKind.NONE;
}