use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class BaseFile method getAnnotations.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.ISVNRemoteFile#getAnnotations(org.tigris.subversion.svnclientadapter.SVNRevision, org.tigris.subversion.svnclientadapter.SVNRevision)
*/
public ISVNAnnotations getAnnotations(SVNRevision fromRevision, SVNRevision toRevision, boolean includeMergedRevisions, boolean ignoreMimeType) throws TeamException {
ISVNClientAdapter svnClient = getRepository().getSVNClient();
try {
SVNRevision pegRevision = null;
ISVNLocalResource localResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
if (localResource != null) {
pegRevision = localResource.getRevision();
}
return svnClient.annotate(localResourceStatus.getFile(), fromRevision, toRevision, pegRevision, ignoreMimeType, includeMergedRevisions);
} catch (SVNClientException e) {
throw new TeamException("Failed in BaseFile.getAnnotations()", e);
} finally {
getRepository().returnSVNClient(svnClient);
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class AddIgnoredPatternCommand method run.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.commands.ISVNCommand#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws SVNException {
monitor = Policy.monitorFor(monitor);
// $NON-NLS-1$
monitor.beginTask(null, 100);
if (!folder.getStatus().isManaged())
throw new SVNException(IStatus.ERROR, TeamException.UNABLE, Policy.bind("SVNTeamProvider.ErrorSettingIgnorePattern", // $NON-NLS-1$
folder.getIResource().getFullPath().toString()));
ISVNClientAdapter svnClient = folder.getRepository().getSVNClient();
try {
OperationManager.getInstance().beginOperation(svnClient);
try {
svnClient.addToIgnoredPatterns(folder.getFile(), pattern);
// broadcast changes to unmanaged children - they are the only candidates for being ignored
ISVNResource[] members = folder.members(null, ISVNFolder.UNMANAGED_MEMBERS);
IResource[] possiblesIgnores = new IResource[members.length];
for (int i = 0; i < members.length; i++) {
possiblesIgnores[i] = ((ISVNLocalResource) members[i]).getIResource();
}
folder.refreshStatus(false);
SVNProviderPlugin.broadcastSyncInfoChanges(possiblesIgnores, false);
broadcastNestedFolders(possiblesIgnores);
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
}
} finally {
OperationManager.getInstance().endOperation();
monitor.done();
folder.getRepository().returnSVNClient(svnClient);
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class ChangeCommitPropertiesCommand method run.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.commands.ISVNCommand#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws SVNException {
// $NON-NLS-1$
monitor.beginTask(null, 100);
ISVNClientAdapter svnClient = repositoryLocation.getSVNClient();
try {
OperationManager.getInstance().beginOperation(svnClient);
try {
if (logMessage != null) {
svnClient.setRevProperty(repositoryLocation.getUrl(), revisionNo, "svn:log", logMessage, true);
logMessageChanged = true;
}
if (author != null) {
svnClient.setRevProperty(repositoryLocation.getUrl(), revisionNo, "svn:author", author, true);
authorChanged = true;
}
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
}
} finally {
repositoryLocation.returnSVNClient(svnClient);
OperationManager.getInstance().endOperation();
monitor.done();
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class ResolveResourcesCommand method run.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.commands.ISVNCommand#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws SVNException {
ISVNClientAdapter svnClient = root.getRepository().getSVNClient();
try {
svnClient.addNotifyListener(operationResourceCollector);
OperationManager.getInstance().beginOperation(svnClient);
for (int i = 0; i < resources.length; i++) {
svnClient.resolve(resources[i].getLocation().toFile(), resolution);
monitor.worked(100);
}
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
Set<IResource> operationResources = operationResourceCollector.getOperationResources();
OperationManager.getInstance().endOperation(true, operationResources);
if (svnClient != null) {
svnClient.removeNotifyListener(operationResourceCollector);
root.getRepository().returnSVNClient(svnClient);
}
monitor.done();
}
}
use of org.tigris.subversion.svnclientadapter.ISVNClientAdapter in project subclipse by subclipse.
the class SwitchToUrlCommand method run.
/* (non-Javadoc)
* @see org.tigris.subversion.subclipse.core.commands.ISVNCommand#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public void run(final IProgressMonitor monitor) throws SVNException {
final ISVNClientAdapter svnClient = root.getRepository().getSVNClient();
OperationManager.getInstance().beginOperation(svnClient, new OperationProgressNotifyListener(monitor, svnClient));
try {
SVNProviderPlugin.run(new ISVNRunnable() {
public void run(IProgressMonitor monitor) throws SVNException {
try {
monitor.beginTask(null, Policy.INFINITE_PM_GUESS_FOR_SWITCH);
if (conflictResolver != null) {
svnClient.addConflictResolutionCallback(conflictResolver);
}
svnClient.addNotifyListener(operationResourceCollector);
File file = resource.getLocation().toFile();
svnClient.switchToUrl(file, svnUrl, svnRevision, svnRevision, depth, setDepth, ignoreExternals, force, ignoreAncestry);
OperationManager.getInstance().onNotify(resource.getLocation().toFile(), SVNNodeKind.UNKNOWN);
} catch (SVNClientException e) {
throw SVNException.wrapException(e);
} finally {
if (svnClient != null) {
if (conflictResolver != null) {
svnClient.addConflictResolutionCallback(null);
}
root.getRepository().returnSVNClient(svnClient);
}
monitor.done();
}
}
}, resource.getProject(), Policy.monitorFor(monitor));
} finally {
Set<IResource> operationResources = operationResourceCollector.getOperationResources();
if (operationResources.size() == 0) {
IResource[] resources = SVNWorkspaceRoot.getResourcesFor(resource);
for (IResource refreshResource : resources) {
operationResources.add(refreshResource);
}
}
OperationManager.getInstance().endOperation(true, operationResources);
}
}
Aggregations