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

The following examples show how to use org.tigris.subversion.svnclientadapter.SVNStatusKind#CONFLICTED . 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: ResolveConflictsAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private static Map<File, ISVNStatus> getPropertyConflicts (File[] files) {
    Map<File, ISVNStatus> propertyConflicts = new HashMap<File, ISVNStatus>(files.length);
    if (files.length > 0) {
        try {
            SvnClient client = Subversion.getInstance().getClient(false);
            FileStatusCache cache = Subversion.getInstance().getStatusCache();
            for (File file : files) {
                if ((cache.getStatus(file).getStatus() & FileInformation.STATUS_VERSIONED_CONFLICT_CONTENT) != 0) {
                    ISVNStatus status = SvnUtils.getSingleStatus(client, file);
                    if (status.getPropStatus() == SVNStatusKind.CONFLICTED) {
                        propertyConflicts.put(file, status);
                    }
                }
            }
        } catch (SVNClientException ex) {
            Subversion.LOG.log(Level.INFO, null, ex);
        }
    }
    return propertyConflicts;
}
 
Example 2
Source File: SvnClientJavaHl.java    From MergeProcessor with Apache License 2.0 5 votes vote down vote up
private static String getConflictPath(ISVNStatus status) {
	if (status.hasTreeConflict()) {
		return status.getConflictDescriptor().getPath();
	} else if (status.getConflictWorking() != null) {
		return status.getConflictWorking().toString();
	} else if (status.getTextStatus() == SVNStatusKind.CONFLICTED) {
		return status.getFile().toString();
	} else {
		return null;
	}
}
 
Example 3
Source File: SvnClientJavaHl.java    From MergeProcessor with Apache License 2.0 5 votes vote down vote up
/**
 * Checks the given {@link ISVNStatus} if modifications exist.
 * 
 * @param status the {@link ISVNStatus}
 * @return {@code true} if modifications exist
 */
private static boolean isModified(ISVNStatus status) {
	final SVNStatusKind textStatus = status.getTextStatus();
	if (textStatus == SVNStatusKind.ADDED || textStatus == SVNStatusKind.CONFLICTED
			|| textStatus == SVNStatusKind.DELETED || textStatus == SVNStatusKind.MERGED
			|| textStatus == SVNStatusKind.MODIFIED || textStatus == SVNStatusKind.REPLACED) {
		return true;
	} else {
		final SVNStatusKind propStatus = status.getPropStatus();
		return propStatus == SVNStatusKind.ADDED || propStatus == SVNStatusKind.CONFLICTED
				|| propStatus == SVNStatusKind.DELETED || propStatus == SVNStatusKind.MERGED
				|| propStatus == SVNStatusKind.MODIFIED || propStatus == SVNStatusKind.REPLACED;
	}
}
 
Example 4
Source File: ResourceWithStatusUtil.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public static SVNStatusKind getStatusKind(IResource resource) {
	ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
	SVNStatusKind statusKind = null;
       try {
           LocalResourceStatus status = svnResource.getStatus();
	       if (status.isTextConflicted())
	    	   statusKind = SVNStatusKind.CONFLICTED;
	       else	            
            if (status.isAdded())
               statusKind = SVNStatusKind.ADDED;
              else
              if (status.isDeleted())
           	   statusKind = SVNStatusKind.DELETED;
              else
       	   if (status.isMissing())
       		   statusKind = SVNStatusKind.MISSING;
       	   else
       	   if (status.isReplaced())
       		   statusKind = SVNStatusKind.REPLACED;
       	   else
              if (status.isTextModified())
           	   statusKind = SVNStatusKind.MODIFIED;			           
              else
              if (!status.isManaged())
           	   statusKind = SVNStatusKind.UNVERSIONED;
       } catch (TeamException e) {}
	return statusKind;
}
 
Example 5
Source File: SVNStatusSyncInfo.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private boolean isChange(SVNStatusKind kind) {
    return kind == SVNStatusKind.MODIFIED 
          || kind == SVNStatusKind.REPLACED
          || kind == SVNStatusKind.OBSTRUCTED
          || kind == SVNStatusKind.CONFLICTED
          || kind == SVNStatusKind.MERGED;
}
 
Example 6
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 7
Source File: GenerateDiffFileSynchronizeOperation.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
protected void run(SVNTeamProvider provider, SyncInfoSet set, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
		IResource[] resources = set.getResources();
		HashMap statusMap = new HashMap();
		unaddedList = new ArrayList();
		for (int i = 0; i < resources.length; i++) {
			ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resources[i]);
			SyncInfo syncInfo = set.getSyncInfo(resources[i]);
			SVNStatusKind statusKind = null;
			try {
				if (!svnResource.isManaged()) {
					statusKind = SVNStatusKind.UNVERSIONED;
				} else {
					switch (SyncInfo.getChange(syncInfo.getKind())) {
					case SyncInfo.ADDITION:
						statusKind = SVNStatusKind.ADDED;
						break;
					case SyncInfo.DELETION:
						statusKind = SVNStatusKind.DELETED;
						break;
					case SyncInfo.CONFLICTING:
						statusKind = SVNStatusKind.CONFLICTED;
						break;				
					default:
						statusKind = SVNStatusKind.MODIFIED;
						break;
					}
				}
				statusMap.put(resources[i], statusKind);				
				if (!svnResource.isManaged() && !svnResource.isIgnored())
					unaddedList.add(resources[i]);
			} catch (SVNException e) {
				SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
			}
		}
		ArrayList dedupedList = new ArrayList();
		Iterator iter = unaddedList.iterator();
		while (iter.hasNext()) {
			IResource resource = (IResource)iter.next();
			if (!isDupe(resource)) dedupedList.add(resource);
		}
		
		IResource[] unversionedResources = new IResource[dedupedList.size()];
		dedupedList.toArray(unversionedResources);
		GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(resources), unversionedResources, statusMap);
		wizard.setWindowTitle(Policy.bind("GenerateSVNDiff.title")); //$NON-NLS-1$
		wizard.setSelectedResources(selectedResources);
//		final WizardDialog dialog = new WizardDialog(getShell(), wizard);
//		dialog.setMinimumPageSize(350, 250);
		final WizardDialog dialog = new WizardDialogWithPersistedLocation(getShell(), wizard, "GenerateDiffFileWizard"); //$NON-NLS-1$
		dialog.setMinimumPageSize(350, 250);
		getShell().getDisplay().syncExec(new Runnable() {
			public void run() {
				dialog.open();	
			}
		});		
	}