use of org.tigris.subversion.subclipse.core.resources.LocalResource in project subclipse by subclipse.
the class MarkMergedSynchronizeOperation method run.
protected void run(SVNTeamProvider provider, SyncInfoSet set, final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
final IResource[] resources = set.getResources();
run(new WorkspaceModifyOperation() {
protected void execute(IProgressMonitor mon) throws CoreException, InvocationTargetException, InterruptedException {
for (int i = 0; i < resources.length; i++) {
File tempFile = null;
try {
tempFile = copyToTempFile(resources[i]);
} catch (Exception e) {
SVNUIPlugin.log(e.getMessage());
showErrorMessage(e);
return;
}
if (monitor.isCanceled()) {
if (tempFile != null)
tempFile.delete();
return;
}
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resources[i]);
if (svnResource instanceof LocalResource)
((LocalResource) svnResource).revert(false);
else
svnResource.revert();
new UpdateOperation(getPart(), resources[i], SVNRevision.HEAD).run(monitor);
if (monitor.isCanceled()) {
if (tempFile != null)
tempFile.delete();
return;
}
File file = new File(resources[i].getLocation().toString());
try {
copy(tempFile, file);
} catch (Exception e1) {
SVNUIPlugin.log(e1.getMessage());
showErrorMessage(e1);
}
if (tempFile != null)
tempFile.delete();
}
}
}, true, /* cancelable */
PROGRESS_BUSYCURSOR);
}
Aggregations