Search in sources :

Example 21 with SVNUrl

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

the class UnversionedCustomProperty method getSvnRevisionProperties.

public static UnversionedCustomProperty[] getSvnRevisionProperties(final ISVNRemoteResource remoteResource, final SVNRevision revision, final SVNRevision peg, final boolean customOnly) throws SVNException {
    SVNUrl url = remoteResource.getUrl();
    ISVNProperty[] props = getSvnRevisionProperties(url, revision, peg);
    List temp = new ArrayList();
    for (int i = 0; i < props.length; i++) {
        final String name = props[i].getName();
        final String value = props[i].getValue();
        // TODO: pull these from svnPropertyTypes prefixes rather than hardcoding
        if (customOnly && (name.startsWith("svn:") || name.startsWith("bugtraq:") || name.startsWith("tsvn:")))
            continue;
        UnversionedCustomProperty ucp = new UnversionedCustomProperty(name, value);
        temp.add(ucp);
    }
    UnversionedCustomProperty[] ret = new UnversionedCustomProperty[temp.size()];
    int i = 0;
    Iterator iter = temp.iterator();
    while (iter.hasNext()) {
        ret[i++] = (UnversionedCustomProperty) iter.next();
    }
    return ret;
}
Also used : SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) List(java.util.List) ArrayList(java.util.ArrayList) ISVNProperty(org.tigris.subversion.svnclientadapter.ISVNProperty)

Example 22 with SVNUrl

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

the class CommitOperation method getRootURL.

private String getRootURL(ISVNLocalResource localResource) {
    if (!atomicCommit)
        return null;
    ISVNInfo info = getSVNInfo(localResource);
    if (info == null)
        return null;
    SVNUrl repos = info.getRepository();
    if (repos == null)
        return null;
    return repos.toString();
}
Also used : SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) ISVNInfo(org.tigris.subversion.svnclientadapter.ISVNInfo)

Example 23 with SVNUrl

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

the class SvnWizardBranchTagPage method performFinish.

public boolean performFinish() {
    if (projectProperties != null) {
        issue = issueText.getText().trim();
        if (projectProperties.isWarnIfNoIssue() && (issueText.getText().trim().length() == 0)) {
            if (!MessageDialog.openQuestion(getShell(), Policy.bind("BranchTagDialog.title"), Policy.bind("BranchTagDialog.0", projectProperties.getLabel()))) {
                // $NON-NLS-1$ //$NON-NLS-2$
                issueText.setFocus();
                return false;
            }
        }
        if (issueText.getText().trim().length() > 0) {
            String issueError = projectProperties.validateIssue(issueText.getText().trim());
            if (issueError != null) {
                MessageDialog.openError(getShell(), Policy.bind("BranchTagDialog.title"), // $NON-NLS-1$
                issueError);
                issueText.selectAll();
                issueText.setFocus();
                return false;
            }
        }
    }
    toUrlCombo.saveUrl();
    createOnServer = !workingCopyButton.getSelection();
    specificRevision = revisionButton.getSelection();
    makeParents = makeParentsButton.getSelection();
    if (switchAfterBranchTagCheckBox != null) {
        switchAfterBranchTag = switchAfterBranchTagCheckBox.getSelection();
    }
    comment = commitCommentArea.getComment(true);
    if (serverButton.getSelection())
        revision = SVNRevision.HEAD;
    try {
        toUrl = new SVNUrl(toUrlCombo.getText());
        if (revisionButton.getSelection())
            revision = SVNRevision.getRevision(revisionText.getText().trim());
    } catch (Exception e) {
        MessageDialog.openError(getShell(), Policy.bind("BranchTagDialog.title"), // $NON-NLS-1$
        e.getMessage());
        return false;
    }
    if (resource != null)
        updateTagsProperty(toUrl);
    return true;
}
Also used : SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) SVNException(org.tigris.subversion.subclipse.core.SVNException)

Example 24 with SVNUrl

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

the class SvnWizardCompareMultipleResourcesWithBranchTagPage method showLog.

protected void showLog() {
    ISVNRemoteResource remoteResource = null;
    try {
        remoteResource = SVNWorkspaceRoot.getSVNResourceFor(resources[0]).getRepository().getRemoteFile(new SVNUrl(urlCombo.getText()));
    } 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") + " " + // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        urlCombo.getText());
        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) ILogEntry(org.tigris.subversion.subclipse.core.history.ILogEntry) SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) SVNException(org.tigris.subversion.subclipse.core.SVNException) ParseException(java.text.ParseException) MalformedURLException(java.net.MalformedURLException)

Example 25 with SVNUrl

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

the class SvnWizardCompareMultipleResourcesWithBranchTagPage method performFinish.

public boolean performFinish() {
    urlCombo.saveUrl();
    try {
        if (urlStrings.length > 1) {
            urls = new SVNUrl[compareResources.length];
            for (int i = 0; i < compareResources.length; i++) {
                if (// $NON-NLS-1$
                urlCombo.getText().endsWith("/"))
                    urls[i] = new SVNUrl(urlCombo.getText() + compareResources[i].getPartialPath());
                else
                    urls[i] = new SVNUrl(// $NON-NLS-1$
                    urlCombo.getText() + "/" + compareResources[i].getPartialPath());
            }
        } else {
            urls = new SVNUrl[1];
            urls[0] = new SVNUrl(urlCombo.getText());
        }
        if (headButton.getSelection())
            revision = SVNRevision.HEAD;
        else {
            try {
                revision = SVNRevision.getRevision(revisionText.getText().trim());
            } catch (ParseException e1) {
                MessageDialog.openError(getShell(), Policy.bind("SvnWizardCompareMultipleResourcesWithBranchTagPage.0"), // $NON-NLS-1$ //$NON-NLS-2$
                Policy.bind("SwitchDialog.invalid"));
                return false;
            }
        }
    } catch (MalformedURLException e) {
        MessageDialog.openError(getShell(), Policy.bind("SvnWizardCompareMultipleResourcesWithBranchTagPage.0"), // $NON-NLS-1$
        e.getMessage());
        return false;
    }
    return true;
}
Also used : MalformedURLException(java.net.MalformedURLException) SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) ParseException(java.text.ParseException)

Aggregations

SVNUrl (org.tigris.subversion.svnclientadapter.SVNUrl)83 SVNException (org.tigris.subversion.subclipse.core.SVNException)29 SVNRevision (org.tigris.subversion.svnclientadapter.SVNRevision)26 MalformedURLException (java.net.MalformedURLException)25 ISVNRemoteResource (org.tigris.subversion.subclipse.core.ISVNRemoteResource)21 ISVNClientAdapter (org.tigris.subversion.svnclientadapter.ISVNClientAdapter)19 ParseException (java.text.ParseException)18 ILogEntry (org.tigris.subversion.subclipse.core.history.ILogEntry)17 IResource (org.eclipse.core.resources.IResource)16 InvocationTargetException (java.lang.reflect.InvocationTargetException)14 ISVNRepositoryLocation (org.tigris.subversion.subclipse.core.ISVNRepositoryLocation)14 TeamException (org.eclipse.team.core.TeamException)13 SVNClientException (org.tigris.subversion.svnclientadapter.SVNClientException)13 ArrayList (java.util.ArrayList)12 ISVNInfo (org.tigris.subversion.svnclientadapter.ISVNInfo)12 File (java.io.File)11 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)10 RemoteFile (org.tigris.subversion.subclipse.core.resources.RemoteFile)10 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)8 RemoteFolder (org.tigris.subversion.subclipse.core.resources.RemoteFolder)8