use of org.tigris.subversion.svnclientadapter.SVNStatusKind in project subclipse by subclipse.
the class SVNStatusSyncInfo method calculateKind.
/* (non-Javadoc)
* @see org.eclipse.team.core.synchronize.SyncInfo#calculateKind()
*/
protected int calculateKind() throws TeamException {
SVNStatusKind localKind = baseStatusInfo.getStatusKind();
SVNStatusKind repositoryKind = (remoteStatusInfo != null) ? remoteStatusInfo.getStatusKind() : SVNStatusKind.NORMAL;
IResource local = getLocal();
boolean filtered = !local.exists() && local.getLocation().toFile().exists();
if (filtered) {
return SyncInfo.IN_SYNC;
}
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;
// 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();
}
use of org.tigris.subversion.svnclientadapter.SVNStatusKind in project subclipse by subclipse.
the class StatusAndInfoCommand method collectRemoteStatuses.
private RemoteResourceStatus[] collectRemoteStatuses(ISVNStatus[] statuses, ISVNClientAdapter client, final IProgressMonitor monitor) {
monitor.beginTask("", statuses.length);
try {
RemoteResourceStatus[] result = new RemoteResourceStatus[statuses.length];
Arrays.sort(statuses, new Comparator() {
public int compare(Object o1, Object o2) {
return ((ISVNStatus) o1).getPath().compareTo(((ISVNStatus) o2).getPath());
}
});
for (int i = 0; i < statuses.length; i++) {
ISVNStatus status = statuses[i];
SVNStatusKind localTextStatus = status.getTextStatus();
if (SVNStatusKind.UNVERSIONED.equals(localTextStatus) || SVNStatusKind.ADDED.equals(localTextStatus) || SVNStatusKind.IGNORED.equals(localTextStatus)) {
if (SVNStatusKind.NONE.equals(status.getRepositoryTextStatus()))
result[i] = RemoteResourceStatus.NONE;
else
result[i] = new RemoteResourceStatus(statuses[i], getRevisionFor(statuses[i]));
} else {
result[i] = new RemoteResourceStatus(statuses[i], getRevisionFor(statuses[i]));
}
monitor.worked(1);
}
return result;
} finally {
monitor.done();
}
}
use of org.tigris.subversion.svnclientadapter.SVNStatusKind in project subclipse by subclipse.
the class GenerateDiffFileSynchronizeOperation method run.
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);
// $NON-NLS-1$
wizard.setWindowTitle(Policy.bind("GenerateSVNDiff.title"));
wizard.setSelectedResources(selectedResources);
// final WizardDialog dialog = new WizardDialog(getShell(), wizard);
// dialog.setMinimumPageSize(350, 250);
final WizardDialog dialog = new WizardDialogWithPersistedLocation(getShell(), wizard, // $NON-NLS-1$
"GenerateDiffFileWizard");
dialog.setMinimumPageSize(350, 250);
getShell().getDisplay().syncExec(new Runnable() {
public void run() {
dialog.open();
}
});
}
use of org.tigris.subversion.svnclientadapter.SVNStatusKind in project subclipse by subclipse.
the class ResourceWithStatusUtil method getStatusKind.
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;
}
use of org.tigris.subversion.svnclientadapter.SVNStatusKind in project subclipse by subclipse.
the class ResourceStatus method getTextStatus.
public SVNStatusKind getTextStatus() {
SVNStatusKind statusKind = SVNStatusKind.fromInt(textStatus);
statusKind.setTreeConflicted(treeConflicted);
return statusKind;
}
Aggregations