Search in sources :

Example 11 with SVNRevision

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

the class UpdateSynchronizeOperation method run.

protected void run(SVNTeamProvider provider, SyncInfoSet set, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
    IResource[] resourceArray = extractResources(resources, set);
    Map<ISVNRepositoryLocation, List<IResource>> items = groupByRepository(resourceArray, set);
    Set<ISVNRepositoryLocation> keys = items.keySet();
    for (Iterator<ISVNRepositoryLocation> iterator = keys.iterator(); iterator.hasNext(); ) {
        ISVNRepositoryLocation repos = iterator.next();
        List<IResource> resourceList = items.get(repos);
        resourceArray = new IResource[resourceList.size()];
        resourceList.toArray(resourceArray);
        SVNRevision revision = getRevisionForUpdate(resourceArray, set);
        IResource[] resourcesToUpdate = changeSetSelected ? resourceArray : trimResources(resourceArray);
        doUpdate(provider, monitor, resourcesToUpdate, revision);
        if (SVNProviderPlugin.getPlugin().getPluginPreferences().getBoolean(ISVNCoreConstants.PREF_SHOW_OUT_OF_DATE_FOLDERS) && resourcesToUpdate.length != resourceArray.length) {
            try {
                SVNWorkspaceSubscriber.getInstance().refresh(resourceArray, IResource.DEPTH_INFINITE, monitor);
            } catch (TeamException e) {
            }
        }
    }
}
Also used : TeamException(org.eclipse.team.core.TeamException) ISVNRepositoryLocation(org.tigris.subversion.subclipse.core.ISVNRepositoryLocation) ArrayList(java.util.ArrayList) List(java.util.List) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) IResource(org.eclipse.core.resources.IResource)

Example 12 with SVNRevision

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

the class SvnRevPropertiesView method getSvnRevProperties.

private ISVNProperty[] getSvnRevProperties() throws SVNException {
    if (resource != null && resource.isManaged()) {
        SVNRevision rev = resource.getRevision();
        ISVNRemoteResource remoteResource = resource.getRemoteResource(rev);
        return UnversionedCustomProperty.getSvnRevisionProperties(remoteResource.getUrl(), rev, null);
    }
    if (remoteResource != null) {
        SVNRevision rev = remoteResource.getRevision();
        return UnversionedCustomProperty.getSvnRevisionProperties(remoteResource.getUrl(), rev, null);
    }
    return null;
}
Also used : ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision)

Example 13 with SVNRevision

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

the class ResolveTreeConflictWizard method getLogMessages.

private ISVNLogMessage[] getLogMessages() throws Exception {
    if (logMessages == null) {
        ISVNClientAdapter svnClient = null;
        try {
            svnClient = svnResource.getRepository().getSVNClient();
            IProject project = treeConflict.getResource().getProject();
            ISVNLocalResource svnProject = SVNWorkspaceRoot.getSVNResourceFor(project);
            SVNRevision revision1 = new SVNRevision.Number(treeConflict.getConflictDescriptor().getSrcLeftVersion().getPegRevision());
            SVNRevision revision2 = new SVNRevision.Number(treeConflict.getConflictDescriptor().getSrcRightVersion().getPegRevision());
            logMessages = svnClient.getLogMessages(svnProject.getUrl(), revision1, revision2, true);
        } catch (Exception e) {
            throw e;
        } finally {
            svnResource.getRepository().returnSVNClient(svnClient);
        }
    }
    return logMessages;
}
Also used : SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) ISVNLocalResource(org.tigris.subversion.subclipse.core.ISVNLocalResource) IProject(org.eclipse.core.resources.IProject) CoreException(org.eclipse.core.runtime.CoreException) SVNException(org.tigris.subversion.subclipse.core.SVNException) SVNClientException(org.tigris.subversion.svnclientadapter.SVNClientException) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Example 14 with SVNRevision

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

the class ComparePropertiesDialog method okPressed.

@Override
protected void okPressed() {
    try {
        if (fromWorkingCopyButton.getSelection()) {
            left = new PropertyCompareLocalResourceNode(fromLocalResource, recursiveButton.getSelection(), null);
        } else {
            SVNRevision revision = null;
            if (fromHeadButton.getSelection()) {
                revision = SVNRevision.HEAD;
            } else {
                revision = new SVNRevision.Number(Long.parseLong(fromRevisionText.getText()));
            }
            RemoteFolder remoteFolder = new RemoteFolder(repository, new SVNUrl(fromRepositoryText.getText().trim()), revision);
            left = new PropertyCompareRemoteResourceNode(remoteFolder, revision, recursiveButton.getSelection(), null);
        }
        if (toWorkingCopyButton.getSelection()) {
            right = new PropertyCompareLocalResourceNode(toLocalResource, recursiveButton.getSelection(), null);
        } else {
            SVNRevision revision = null;
            if (toHeadButton.getSelection()) {
                revision = SVNRevision.HEAD;
            } else {
                revision = new SVNRevision.Number(Long.parseLong(toRevisionText.getText()));
            }
            RemoteFolder remoteFolder = new RemoteFolder(repository, new SVNUrl(toRepositoryText.getText().trim()), revision);
            right = new PropertyCompareRemoteResourceNode(remoteFolder, revision, recursiveButton.getSelection(), null);
        }
        input = new PropertyCompareInput(left, right, recursiveButton.getSelection());
    } catch (Exception e) {
        MessageDialog.openError(getShell(), Policy.bind("ComparePropertiesDialog.1"), // $NON-NLS-1$
        e.getMessage());
        return;
    }
    super.okPressed();
}
Also used : PropertyCompareLocalResourceNode(org.tigris.subversion.subclipse.ui.compare.PropertyCompareLocalResourceNode) PropertyCompareInput(org.tigris.subversion.subclipse.ui.compare.PropertyCompareInput) RemoteFolder(org.tigris.subversion.subclipse.core.resources.RemoteFolder) SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) PropertyCompareRemoteResourceNode(org.tigris.subversion.subclipse.ui.compare.PropertyCompareRemoteResourceNode) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision)

Example 15 with SVNRevision

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

the class ExportRemoteFolderDialog method okPressed.

protected void okPressed() {
    boolean success = true;
    SVNRevision revision = null;
    if (headButton.getSelection())
        revision = SVNRevision.HEAD;
    else {
        int revisionNumber = Integer.parseInt(revisionText.getText().trim());
        long revisionLong = revisionNumber;
        revision = new SVNRevision.Number(revisionLong);
    }
    File directory = new File(directoryText.getText().trim() + File.separator + remoteResource.getName());
    try {
        new ExportRemoteFolderOperation(targetPart, remoteResource, directory, revision).run();
    } catch (Exception e) {
        MessageDialog.openError(getShell(), Policy.bind("ExportRemoteFolderAction.directoryDialogText"), // $NON-NLS-1$
        e.getMessage());
        success = false;
    }
    if (!success)
        return;
    super.okPressed();
}
Also used : SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) File(java.io.File) ExportRemoteFolderOperation(org.tigris.subversion.subclipse.ui.operations.ExportRemoteFolderOperation)

Aggregations

SVNRevision (org.tigris.subversion.svnclientadapter.SVNRevision)48 SVNUrl (org.tigris.subversion.svnclientadapter.SVNUrl)22 ISVNClientAdapter (org.tigris.subversion.svnclientadapter.ISVNClientAdapter)17 IResource (org.eclipse.core.resources.IResource)15 TeamException (org.eclipse.team.core.TeamException)15 SVNException (org.tigris.subversion.subclipse.core.SVNException)14 InvocationTargetException (java.lang.reflect.InvocationTargetException)12 ISVNRemoteResource (org.tigris.subversion.subclipse.core.ISVNRemoteResource)12 File (java.io.File)9 CoreException (org.eclipse.core.runtime.CoreException)9 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)9 ISVNLocalResource (org.tigris.subversion.subclipse.core.ISVNLocalResource)9 ArrayList (java.util.ArrayList)8 ISelection (org.eclipse.jface.viewers.ISelection)8 ILogEntry (org.tigris.subversion.subclipse.core.history.ILogEntry)8 PartInitException (org.eclipse.ui.PartInitException)7 ISVNRepositoryLocation (org.tigris.subversion.subclipse.core.ISVNRepositoryLocation)7 RemoteFile (org.tigris.subversion.subclipse.core.resources.RemoteFile)7 ParseException (java.text.ParseException)6 Action (org.eclipse.jface.action.Action)6