if (localResource.isDirty()) { localResource.revert(); }
if(!localResource.isManaged() && removeUnAdded) { try { resource.delete(true, monitor); } catch (CoreException ex) { throw SVNException.wrapException(ex); } } else if (localResource.isDirty()) { localResource.revert(); }
    protected void execute(SVNTeamProvider provider, IResource[] resources, IProgressMonitor monitor) throws SVNException, InterruptedException {        monitor.beginTask(null, 100);		try {            // first we revert to base (otherwise it will do a merge instead of            // replace resources)		    for (int i = 0; i < resources.length; i++) {                IResource resource = resources[i];                ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor(resource);    			if (localResource.isDirty()) {    				localResource.revert();    			}            }		    // We are already at the base revision after a revert, no need to update		    if (this.revision.equals(SVNRevision.BASE)) {		    	return;		    }		                // then we update to revision		    super.execute(provider, resources, monitor);		} catch (SVNException e) {		    collectStatus(e.getStatus());		} finally {			monitor.done();		}    }