use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class RecursiveStatusUpdateStrategy method statusesToUpdate.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.status.StatusUpdateStrategy#statusesToUpdate(org.eclipse.core.resources.IResource)
*/
protected ISVNStatus[] statusesToUpdate(IResource resource) throws SVNException {
if (!(resource instanceof IProject)) {
// if the status of the resource parent is not known, we
// recursively update it instead
IContainer parent = resource.getParent();
if (parent != null) {
if (statusCache.getStatus(parent) == null) {
return statusesToUpdate(parent);
}
}
}
if (Policy.DEBUG_STATUS) {
// $NON-NLS-1$
System.out.println("[svn] getting status for : " + resource.getFullPath());
}
// don't do getRepository().getSVNClient() as we can ask the status of a file
// that is not associated with a known repository
// we don't need login & password so this is not a problem
ISVNStatus[] statuses = null;
ISVNClientAdapter svnClientAdapterStatus = null;
try {
SVNProviderPlugin.disableConsoleLogging();
svnClientAdapterStatus = SVNProviderPlugin.getPlugin().getSVNClient();
statuses = svnClientAdapterStatus.getStatus(resource.getLocation().toFile(), true, true);
} catch (SVNClientException e1) {
if (!e1.getMessage().contains(SVNProviderPlugin.UPGRADE_NEEDED)) {
throw SVNException.wrapException(e1);
}
} finally {
SVNProviderPlugin.enableConsoleLogging();
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(svnClientAdapterStatus);
}
return collectUnversionedFolders(statuses, true);
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class LocalFile method addKeywords.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.ISVNLocalFile#addKeywords(org.tigris.subversion.svnclientadapter.SVNKeywords)
*/
public void addKeywords(SVNKeywords svnKeywords) throws SVNException {
ISVNClientAdapter svnClient = null;
try {
svnClient = getRepository().getSVNClient();
OperationManager.getInstance().beginOperation(svnClient);
svnClient.addKeywords(getFile(), svnKeywords);
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
getRepository().returnSVNClient(svnClient);
OperationManager.getInstance().endOperation();
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class LocalFile method setKeywords.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.ISVNLocalFile#setKeywords(org.tigris.subversion.svnclientadapter.SVNKeywords)
*/
public void setKeywords(SVNKeywords svnKeywords) throws SVNException {
ISVNClientAdapter svnClient = null;
try {
svnClient = getRepository().getSVNClient();
OperationManager.getInstance().beginOperation(svnClient);
svnClient.setKeywords(getFile(), svnKeywords, false);
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
getRepository().returnSVNClient(svnClient);
OperationManager.getInstance().endOperation();
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class LocalResource method deleteSvnProperty.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.ISVNLocalResource#deleteSvnProperty(java.lang.String, boolean)
*/
public void deleteSvnProperty(String name, boolean recurse) throws SVNException {
OperationResourceCollector operationResourceCollector = new OperationResourceCollector();
ISVNClientAdapter svnClient = getRepository().getSVNClient();
try {
svnClient.addNotifyListener(operationResourceCollector);
OperationManager.getInstance().beginOperation(svnClient);
svnClient.propertyDel(getFile(), name, recurse);
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
OperationManager.getInstance().endOperation(true, operationResourceCollector.getOperationResources());
if (svnClient != null) {
svnClient.removeNotifyListener(operationResourceCollector);
getRepository().returnSVNClient(svnClient);
}
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class LocalResource method setSvnProperty.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.ISVNLocalResource#setSvnProperty(java.lang.String, java.io.File, boolean)
*/
public void setSvnProperty(String name, File value, boolean recurse) throws SVNException {
OperationResourceCollector operationResourceCollector = new OperationResourceCollector();
ISVNClientAdapter svnClient = getRepository().getSVNClient();
try {
svnClient.addNotifyListener(operationResourceCollector);
OperationManager.getInstance().beginOperation(svnClient);
svnClient.propertySet(getFile(), name, value, recurse);
} catch (IOException e) {
throw SVNException.wrapException(e);
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
OperationManager.getInstance().endOperation(true, operationResourceCollector.getOperationResources());
if (svnClient != null) {
svnClient.removeNotifyListener(operationResourceCollector);
getRepository().returnSVNClient(svnClient);
}
}
}
Aggregations