Search in sources :

Example 66 with ISVNClientAdapter

use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.

the class LocalResource method resolve.

/* (non-Javadoc)
   * @see org.tigris.subversion.subclipse.core.ISVNLocalResource#resolve()
   */
public void resolve() throws SVNException {
    ISVNClientAdapter svnClient = null;
    try {
        svnClient = getRepository().getSVNClient();
        OperationManager.getInstance().beginOperation(svnClient);
        svnClient.resolved(getFile());
    } catch (SVNClientException e) {
        throw SVNException.wrapException(e);
    } finally {
        getRepository().returnSVNClient(svnClient);
        OperationManager.getInstance().endOperation();
    }
}
Also used : SVNClientException(org.tigris.subversion.svnclientadapter.SVNClientException) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Example 67 with ISVNClientAdapter

use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.

the class LocalResource method delete.

/* (non-Javadoc)
   * @see org.tigris.subversion.subclipse.core.ISVNLocalResource#delete()
   */
public void delete() throws SVNException {
    ISVNClientAdapter svnClient = null;
    try {
        svnClient = getRepository().getSVNClient();
        OperationManager.getInstance().beginOperation(svnClient);
        svnClient.remove(new File[] { getFile() }, true);
    } catch (SVNClientException e) {
        throw SVNException.wrapException(e);
    } finally {
        getRepository().returnSVNClient(svnClient);
        OperationManager.getInstance().endOperation();
    }
}
Also used : SVNClientException(org.tigris.subversion.svnclientadapter.SVNClientException) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Example 68 with ISVNClientAdapter

use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.

the class LocalResource method revert.

/**
 * Restore pristine working copy file (undo all local edits)
 */
public void revert(boolean recurse) throws SVNException {
    ISVNClientAdapter svnClient = null;
    try {
        try {
            Util.saveLocalHistory(resource);
        } catch (CoreException e) {
            SVNProviderPlugin.log(IStatus.ERROR, e.getMessage(), e);
        }
        svnClient = getRepository().getSVNClient();
        OperationManager.getInstance().beginOperation(svnClient);
        svnClient.revert(getFile(), recurse);
    } catch (SVNClientException e) {
        throw SVNException.wrapException(e);
    } finally {
        getRepository().returnSVNClient(svnClient);
        Set<IResource> refreshList = new HashSet<IResource>();
        refreshList.add(getResource());
        OperationManager.getInstance().endOperation(true, refreshList);
    }
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) SVNClientException(org.tigris.subversion.svnclientadapter.SVNClientException) IResource(org.eclipse.core.resources.IResource) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter) HashSet(java.util.HashSet)

Example 69 with ISVNClientAdapter

use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.

the class LocalResource method getSvnProperty.

/* (non-Javadoc)
   * @see org.tigris.subversion.subclipse.core.ISVNLocalResource#getSvnProperty(java.lang.String)
   */
public ISVNProperty getSvnProperty(String name) throws SVNException {
    ISVNClientAdapter svnClient = null;
    try {
        svnClient = SVNProviderPlugin.getPlugin().getSVNClient();
        SVNProviderPlugin.disableConsoleLogging();
        ISVNProperty prop = svnClient.propertyGet(getFile(), name);
        return prop;
    } catch (SVNClientException e) {
        throw SVNException.wrapException(e);
    } finally {
        SVNProviderPlugin.enableConsoleLogging();
        SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(svnClient);
    }
}
Also used : SVNClientException(org.tigris.subversion.svnclientadapter.SVNClientException) ISVNProperty(org.tigris.subversion.svnclientadapter.ISVNProperty) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Example 70 with ISVNClientAdapter

use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.

the class RemoteFolder method createRemoteFolder.

/* (non-Javadoc)
   * @see org.tigris.subversion.subclipse.core.ISVNRemoteFolder#createRemoteFolder(java.lang.String, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
   */
public void createRemoteFolder(String folderName, String message, IProgressMonitor monitor) throws SVNException {
    IProgressMonitor progress = Policy.monitorFor(monitor);
    // $NON-NLS-1$
    progress.beginTask(Policy.bind("RemoteFolder.createRemoteFolder"), 100);
    ISVNClientAdapter svnClient = null;
    try {
        svnClient = getRepository().getSVNClient();
        svnClient.mkdir(getUrl().appendPath(folderName), message);
        refresh();
        SVNProviderPlugin.getPlugin().getRepositoryResourcesManager().remoteResourceCreated(this, folderName);
    } catch (SVNClientException e) {
        throw SVNException.wrapException(e);
    } finally {
        getRepository().returnSVNClient(svnClient);
        progress.done();
    }
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) SVNClientException(org.tigris.subversion.svnclientadapter.SVNClientException) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Aggregations

ISVNClientAdapter (org.tigris.subversion.svnclientadapter.ISVNClientAdapter)108 SVNClientException (org.tigris.subversion.svnclientadapter.SVNClientException)67 SVNException (org.tigris.subversion.subclipse.core.SVNException)37 File (java.io.File)28 IResource (org.eclipse.core.resources.IResource)27 CoreException (org.eclipse.core.runtime.CoreException)22 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)21 TeamException (org.eclipse.team.core.TeamException)21 ISVNLocalResource (org.tigris.subversion.subclipse.core.ISVNLocalResource)20 ISVNRepositoryLocation (org.tigris.subversion.subclipse.core.ISVNRepositoryLocation)20 ISVNInfo (org.tigris.subversion.svnclientadapter.ISVNInfo)19 SVNUrl (org.tigris.subversion.svnclientadapter.SVNUrl)19 ArrayList (java.util.ArrayList)18 SVNRevision (org.tigris.subversion.svnclientadapter.SVNRevision)18 InvocationTargetException (java.lang.reflect.InvocationTargetException)15 ISVNProperty (org.tigris.subversion.svnclientadapter.ISVNProperty)13 OperationProgressNotifyListener (org.tigris.subversion.subclipse.core.client.OperationProgressNotifyListener)9 IProject (org.eclipse.core.resources.IProject)8 List (java.util.List)7 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)7