Search in sources :

Example 51 with ISVNRemoteResource

use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.

the class SubclipseLinkedTaskInfo method getText.

public String getText() {
    if (comment == null && changeSet != null) {
        try {
            SyncInfoTree syncInfoSet = changeSet.getSyncInfoSet();
            SVNStatusSyncInfo info = (SVNStatusSyncInfo) syncInfoSet.getSyncInfo(resource);
            ISVNRemoteResource remoteResource = (ISVNRemoteResource) info.getRemote();
            SVNRevision rev = remoteResource.getLastChangedRevision();
            ISVNLogMessage[] messages = remoteResource.getLogMessages(rev, rev, SVNRevision.START, false, false, 1, false);
            comment = messages[0].getMessage();
        } catch (TeamException ex) {
            comment = changeSet.getComment();
        }
    }
    return comment;
}
Also used : TeamException(org.eclipse.team.core.TeamException) SVNStatusSyncInfo(org.tigris.subversion.subclipse.core.sync.SVNStatusSyncInfo) SyncInfoTree(org.eclipse.team.core.synchronize.SyncInfoTree) ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) ISVNLogMessage(org.tigris.subversion.svnclientadapter.ISVNLogMessage)

Example 52 with ISVNRemoteResource

use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.

the class BranchTagWizardCopyPage method showLog.

private void showLog() {
    ISVNRemoteResource remoteResource = null;
    if (((BranchTagWizard) getWizard()).multipleSelections()) {
        ISVNRepositoryLocation repository = null;
        if (resource == null)
            repository = this.remoteResource.getRepository();
        else
            repository = SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository();
        try {
            remoteResource = repository.getRemoteFile(new SVNUrl(((BranchTagWizard) getWizard()).getCommonRoot()));
        } catch (Exception e) {
            MessageDialog.openError(getShell(), Policy.bind("MergeDialog.showLog"), // $NON-NLS-1$
            e.toString());
            return;
        }
    } else {
        if (resource == null)
            remoteResource = this.remoteResource;
        else {
            try {
                remoteResource = SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().getRemoteFile(((BranchTagWizard) getWizard()).getUrl());
            } catch (Exception e) {
                MessageDialog.openError(getShell(), Policy.bind("MergeDialog.showLog"), // $NON-NLS-1$
                e.toString());
                return;
            }
        }
        if (remoteResource == null) {
            MessageDialog.openError(getShell(), Policy.bind("MergeDialog.showLog"), Policy.bind("MergeDialog.urlError") + " " + ((BranchTagWizard) getWizard()).getUrlText());
            return;
        }
    }
    HistoryDialog dialog = new HistoryDialog(getShell(), remoteResource);
    if (dialog.open() == HistoryDialog.CANCEL)
        return;
    ILogEntry[] selectedEntries = dialog.getSelectedLogEntries();
    if (selectedEntries.length == 0)
        return;
    revisionText.setText(Long.toString(selectedEntries[selectedEntries.length - 1].getRevision().getNumber()));
    setPageComplete(canFinish());
}
Also used : HistoryDialog(org.tigris.subversion.subclipse.ui.dialogs.HistoryDialog) ISVNRepositoryLocation(org.tigris.subversion.subclipse.core.ISVNRepositoryLocation) ILogEntry(org.tigris.subversion.subclipse.core.history.ILogEntry) SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource)

Example 53 with ISVNRemoteResource

use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.

the class CheckoutWizardCheckoutAsWithProjectFilePage method getCommonParent.

private ISVNRemoteResource getCommonParent() {
    ISVNRemoteFolder[] remoteFolders = ((CheckoutWizard) getWizard()).getRemoteFolders();
    if (remoteFolders.length == 1)
        return remoteFolders[0];
    ISVNRemoteResource commonParent = null;
    ISVNRemoteResource parent = remoteFolders[0];
    while (commonParent == null) {
        parent = parent.getParent();
        if (parent == null)
            break;
        for (int i = 1; i < remoteFolders.length; i++) {
            if (!remoteFolders[i].getUrl().toString().startsWith(parent.getUrl().toString()))
                break;
        }
        commonParent = parent;
    }
    return commonParent;
}
Also used : ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) ISVNRemoteFolder(org.tigris.subversion.subclipse.core.ISVNRemoteFolder)

Example 54 with ISVNRemoteResource

use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.

the class CheckoutWizardCheckoutAsWithoutProjectFilePage method getCommonParent.

private ISVNRemoteResource getCommonParent() {
    ISVNRemoteFolder[] remoteFolders = ((CheckoutWizard) getWizard()).getRemoteFolders();
    if (remoteFolders.length == 1)
        return remoteFolders[0];
    ISVNRemoteResource commonParent = null;
    ISVNRemoteResource parent = remoteFolders[0];
    while (commonParent == null) {
        parent = parent.getParent();
        if (parent == null)
            break;
        for (int i = 1; i < remoteFolders.length; i++) {
            if (!remoteFolders[i].getUrl().toString().startsWith(parent.getUrl().toString()))
                break;
        }
        commonParent = parent;
    }
    return commonParent;
}
Also used : ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) ISVNRemoteFolder(org.tigris.subversion.subclipse.core.ISVNRemoteFolder)

Example 55 with ISVNRemoteResource

use of org.tigris.subversion.subclipse.core.ISVNRemoteResource in project subclipse by subclipse.

the class CompareSvnPropertiesAction method execute.

public void execute(IAction action) {
    exception = null;
    IResource[] resources = getSelectedResources();
    IPropertyProvider left = null;
    right = null;
    if (resources != null && resources.length > 0) {
        left = new PropertyCompareLocalResourceNode(resources[0], true, null);
        if (resources.length > 1) {
            right = new PropertyCompareLocalResourceNode(resources[1], true, null);
        } else {
            final ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resources[0]);
            BusyIndicator.showWhile(Display.getDefault(), new Runnable() {

                public void run() {
                    try {
                        right = new PropertyCompareRemoteResourceNode(svnResource.getRemoteResource(SVNRevision.HEAD), SVNRevision.HEAD, true, null);
                    } catch (SVNException e) {
                        exception = e;
                    }
                }
            });
            if (exception != null) {
                MessageDialog.openError(getShell(), Policy.bind("CompareSvnPropertiesAction.0"), // $NON-NLS-1$
                exception.getMessage());
                return;
            }
        }
    } else {
        ISVNRemoteResource[] remoteResources = getSelectedRemoteResources();
        if (remoteResources != null && remoteResources.length > 0) {
            left = new PropertyCompareRemoteResourceNode(remoteResources[0], SVNRevision.HEAD, true, null);
            if (remoteResources.length > 1) {
                right = new PropertyCompareRemoteResourceNode(remoteResources[1], SVNRevision.HEAD, true, null);
            }
        }
    }
    ComparePropertiesDialog dialog = new ComparePropertiesDialog(getShell(), left, right);
    if (dialog.open() == ComparePropertiesDialog.OK) {
        CompareUI.openCompareEditorOnPage(dialog.getInput(), getTargetPage());
    }
}
Also used : PropertyCompareLocalResourceNode(org.tigris.subversion.subclipse.ui.compare.PropertyCompareLocalResourceNode) ComparePropertiesDialog(org.tigris.subversion.subclipse.ui.dialogs.ComparePropertiesDialog) IPropertyProvider(org.tigris.subversion.subclipse.ui.compare.IPropertyProvider) PropertyCompareRemoteResourceNode(org.tigris.subversion.subclipse.ui.compare.PropertyCompareRemoteResourceNode) SVNException(org.tigris.subversion.subclipse.core.SVNException) ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) ISVNLocalResource(org.tigris.subversion.subclipse.core.ISVNLocalResource) IResource(org.eclipse.core.resources.IResource)

Aggregations

ISVNRemoteResource (org.tigris.subversion.subclipse.core.ISVNRemoteResource)69 SVNException (org.tigris.subversion.subclipse.core.SVNException)23 SVNUrl (org.tigris.subversion.svnclientadapter.SVNUrl)21 InvocationTargetException (java.lang.reflect.InvocationTargetException)16 TeamException (org.eclipse.team.core.TeamException)16 SVNRevision (org.tigris.subversion.svnclientadapter.SVNRevision)16 IResource (org.eclipse.core.resources.IResource)15 ILogEntry (org.tigris.subversion.subclipse.core.history.ILogEntry)14 ArrayList (java.util.ArrayList)12 ParseException (java.text.ParseException)11 ISVNLocalResource (org.tigris.subversion.subclipse.core.ISVNLocalResource)10 CoreException (org.eclipse.core.runtime.CoreException)9 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)9 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)9 ISVNRepositoryLocation (org.tigris.subversion.subclipse.core.ISVNRepositoryLocation)8 MalformedURLException (java.net.MalformedURLException)7 ISVNRemoteFolder (org.tigris.subversion.subclipse.core.ISVNRemoteFolder)7 RemoteFile (org.tigris.subversion.subclipse.core.resources.RemoteFile)7 HistoryDialog (org.tigris.subversion.subclipse.ui.dialogs.HistoryDialog)6 ISVNClientAdapter (org.tigris.subversion.svnclientadapter.ISVNClientAdapter)6