use of org.tigris.subversion.svnclientadapter.ISVNStatus in project subclipse by subclipse.
the class StatusCacheManager method updateCache.
/**
* 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;
}
use of org.tigris.subversion.svnclientadapter.ISVNStatus in project subclipse by subclipse.
the class StatusUpdateStrategy method collectUnversionedFolders.
/**
* Collect the content of unversioned folders.
*
* @param statuses
* @param recursive
* @return
*/
protected ISVNStatus[] collectUnversionedFolders(ISVNStatus[] statuses, boolean recursive) {
if (statuses == null) {
return null;
}
List<ISVNStatus> processed = new ArrayList<ISVNStatus>();
for (ISVNStatus status : statuses) {
processed.add(status);
if (status.getNodeKind() != SVNNodeKind.FILE && status.getTextStatus() == SVNStatusKind.UNVERSIONED) {
File folder = status.getFile();
if (!folder.isDirectory() && !folder.exists())
continue;
Set<String> alreadyProcessed = new HashSet<String>();
processUnversionedFolder(folder, processed, recursive, alreadyProcessed);
}
}
return processed.toArray(new ISVNStatus[processed.size()]);
}
use of org.tigris.subversion.svnclientadapter.ISVNStatus in project subclipse by subclipse.
the class PeekStatusCommand method execute.
public void execute() throws SVNException {
ISVNClientAdapter client = null;
ISVNNotifyListener revisionListener = new ISVNNotifyListener() {
public void setCommand(int command) {
}
public void logCommandLine(String commandLine) {
}
public void logMessage(String message) {
}
public void logError(String message) {
}
public void logRevision(long aRevision, String path) {
PeekStatusCommand.this.revision = new SVNRevision.Number(aRevision);
}
public void logCompleted(String message) {
}
public void onNotify(File path, SVNNodeKind kind) {
}
};
try {
client = SVNProviderPlugin.getPlugin().getSVNClientManager().getSVNClient();
client.addNotifyListener(revisionListener);
File file;
if (resource != null)
file = resource.getLocation().toFile();
else
file = path.toFile();
status = null;
ISVNStatus[] statuses = client.getStatus(file, false, true, false);
for (int i = 0; i < statuses.length; i++) {
if (file.equals(statuses[i].getFile())) {
status = statuses[i];
if (status.getUrl() == null && !(status.getTextStatus() == SVNStatusKind.UNVERSIONED))
info = client.getInfo(status.getFile());
break;
}
}
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
if (client != null) {
client.removeNotifyListener(revisionListener);
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
}
}
}
use of org.tigris.subversion.svnclientadapter.ISVNStatus 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.ISVNStatus in project subclipse by subclipse.
the class ResolveTreeConflictWizard method getAdds.
public ISVNStatus[] getAdds() throws SVNException {
List adds = new ArrayList();
statuses = getStatuses(false);
for (int i = 0; i < statuses.length; i++) {
if (statuses[i].getTextStatus().equals(SVNStatusKind.ADDED))
adds.add(statuses[i]);
}
ISVNStatus[] addArray = new ISVNStatus[adds.size()];
adds.toArray(addArray);
return addArray;
}
Aggregations