Search in sources :

Example 16 with ISVNProperty

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

the class PropertyConflict method getPropertyConflicts.

public static PropertyConflict[] getPropertyConflicts(ISVNLocalResource svnResource) throws Exception {
    PropertyConflict[] propertyConflicts = null;
    String conflictFileContents = getConflictSummary(svnResource);
    if (conflictFileContents != null) {
        List propertyConflictList = new ArrayList();
        ISVNProperty[] properties = svnResource.getSvnProperties();
        for (int i = 0; i < properties.length; i++) {
            if (conflictFileContents.indexOf("property '" + properties[i].getName() + "'") != -1) {
                PropertyConflict conflict = new PropertyConflict();
                conflict.setPropertyName(properties[i].getName());
                propertyConflictList.add(conflict);
            }
        }
        propertyConflicts = new PropertyConflict[propertyConflictList.size()];
        propertyConflictList.toArray(propertyConflicts);
    }
    return propertyConflicts;
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) ISVNProperty(org.tigris.subversion.svnclientadapter.ISVNProperty)

Example 17 with ISVNProperty

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

the class PropertyCompareRemoteResourceNode method getChildren.

public Object[] getChildren() {
    if (children == null) {
        List<Object> childList = new ArrayList<Object>();
        for (ISVNProperty property : properties) {
            if (property.getUrl().toString().equals(remoteResource.getUrl().toString())) {
                childList.add(new PropertyComparePropertyNode(property));
            }
        }
        if (recursive && remoteResource.isContainer()) {
            try {
                ISVNRemoteResource[] childResources = remoteResource.members(new NullProgressMonitor());
                for (ISVNRemoteResource childResource : childResources) {
                    PropertyCompareRemoteResourceNode childNode = new PropertyCompareRemoteResourceNode(childResource, pegRevision, recursive, properties);
                    childList.add(childNode);
                }
            } catch (CoreException e) {
                SVNUIPlugin.log(e);
            }
        }
        children = new Object[childList.size()];
        childList.toArray(children);
    }
    return children;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) CoreException(org.eclipse.core.runtime.CoreException) ArrayList(java.util.ArrayList) ISVNProperty(org.tigris.subversion.svnclientadapter.ISVNProperty) ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource)

Example 18 with ISVNProperty

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

the class SvnWizardBranchTagPage method updateTagsProperty.

private void updateTagsProperty(SVNUrl toUrl) {
    ISVNClientAdapter svnClient = null;
    try {
        ISVNProperty property = null;
        // $NON-NLS-1$
        property = svnResource.getSvnProperty("subclipse:tags");
        if (property == null)
            return;
        newAlias = new Alias();
        // $NON-NLS-1$
        newAlias.setBranch(toUrl.toString().toUpperCase().indexOf("TAGS") == -1);
        String relativePath = toUrl.toString().substring(svnResource.getRepository().getUrl().toString().length());
        newAlias.setRelativePath(relativePath);
        SVNRevision revision = null;
        if (revisionButton.getSelection())
            revision = SVNRevision.getRevision(revisionText.getText().trim());
        else {
            svnClient = svnResource.getRepository().getSVNClient();
            ISVNInfo svnInfo = svnClient.getInfo(url);
            revision = SVNRevision.getRevision(svnInfo.getRevision().toString());
        }
        newAlias.setRevision(Integer.parseInt(revision.toString()));
        newAlias.setName(toUrl.getLastPathSegment());
        BranchTagPropertyUpdateDialog dialog = new BranchTagPropertyUpdateDialog(getShell(), resource, newAlias, // $NON-NLS-1$
        "BranchTagPropertyUpdateDialog");
        if (dialog.open() == BranchTagPropertyUpdateDialog.OK)
            newAlias = dialog.getNewAlias();
        else
            newAlias = null;
    } catch (Exception e) {
    } finally {
        svnResource.getRepository().returnSVNClient(svnClient);
    }
}
Also used : BranchTagPropertyUpdateDialog(org.tigris.subversion.subclipse.ui.dialogs.BranchTagPropertyUpdateDialog) Alias(org.tigris.subversion.subclipse.core.history.Alias) ISVNInfo(org.tigris.subversion.svnclientadapter.ISVNInfo) ISVNProperty(org.tigris.subversion.svnclientadapter.ISVNProperty) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) SVNException(org.tigris.subversion.subclipse.core.SVNException) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Example 19 with ISVNProperty

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

the class AliasManager method getAliases.

private Alias[] getAliases(SVNUrl url, boolean checkParents) {
    ArrayList<Alias> aliases = new ArrayList<Alias>();
    ISVNClientAdapter client = null;
    try {
        client = SVNProviderPlugin.getPlugin().getSVNClient();
        ISVNProperty property = null;
        SVNProviderPlugin.disableConsoleLogging();
        property = client.propertyGet(url, "subclipse:tags");
        SVNProviderPlugin.enableConsoleLogging();
        if (property != null && property.getValue() != null) {
            getAliases(aliases, property.getValue(), url.toString());
        } else {
            if (url.getParent() != null && checkParents)
                return getAliases(url.getParent(), checkParents);
        }
    } catch (SVNClientException e) {
    } catch (SVNException e) {
    } finally {
        SVNProviderPlugin.enableConsoleLogging();
        SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
    }
    Alias[] aliasArray = new Alias[aliases.size()];
    aliases.toArray(aliasArray);
    return aliasArray;
}
Also used : SVNClientException(org.tigris.subversion.svnclientadapter.SVNClientException) ArrayList(java.util.ArrayList) ISVNProperty(org.tigris.subversion.svnclientadapter.ISVNProperty) SVNException(org.tigris.subversion.subclipse.core.SVNException) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Example 20 with ISVNProperty

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

the class SubclipseLinkedTaskInfo method init.

private void init() {
    TaskRepositoryManager repositoryManager = TasksUiPlugin.getRepositoryManager();
    String[] urls = null;
    ProjectProperties props = null;
    try {
        if (resource != null) {
            props = ProjectProperties.getProjectProperties(resource);
        } else if (logEntry != null) {
            ISVNResource svnres = logEntry.getResource();
            if (svnres != null) {
                if (svnres.getResource() != null) {
                    props = ProjectProperties.getProjectProperties(svnres.getResource());
                } else {
                    ISVNClientAdapter client = SVNProviderPlugin.getPlugin().getSVNClientManager().getSVNClient();
                    SVNProviderPlugin.disableConsoleLogging();
                    ISVNProperty[] properties = client.getProperties(svnres.getUrl());
                    SVNProviderPlugin.enableConsoleLogging();
                    for (int i = 0; i < properties.length; i++) {
                        ISVNProperty property = properties[i];
                        if ("bugtraq:url".equals(property.getName())) {
                            repositoryUrl = SubclipseTeamPlugin.getRepository(property.getValue(), repositoryManager).getRepositoryUrl();
                        // comments?
                        }
                    }
                }
            }
        }
    } catch (Exception ex) {
        // ignore?
        SVNProviderPlugin.enableConsoleLogging();
    }
    if (props != null) {
        if (repositoryUrl == null) {
            repositoryUrl = SubclipseTeamPlugin.getRepository(props.getUrl(), repositoryManager).getRepositoryUrl();
        }
        urls = props.getLinkList(getText()).getUrls();
    }
    if (urls == null || urls.length == 0) {
        urls = ProjectProperties.getUrls(getText()).getUrls();
    }
    if (urls != null && urls.length > 0) {
        taskFullUrl = urls[0];
    }
}
Also used : TaskRepositoryManager(org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager) ISVNResource(org.tigris.subversion.subclipse.core.ISVNResource) ProjectProperties(org.tigris.subversion.subclipse.ui.settings.ProjectProperties) ISVNProperty(org.tigris.subversion.svnclientadapter.ISVNProperty) TeamException(org.eclipse.team.core.TeamException) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Aggregations

ISVNProperty (org.tigris.subversion.svnclientadapter.ISVNProperty)30 ISVNClientAdapter (org.tigris.subversion.svnclientadapter.ISVNClientAdapter)13 SVNException (org.tigris.subversion.subclipse.core.SVNException)11 ArrayList (java.util.ArrayList)9 ISVNLocalResource (org.tigris.subversion.subclipse.core.ISVNLocalResource)8 IResource (org.eclipse.core.resources.IResource)7 SVNClientException (org.tigris.subversion.svnclientadapter.SVNClientException)5 CoreException (org.eclipse.core.runtime.CoreException)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 TeamException (org.eclipse.team.core.TeamException)4 Iterator (java.util.Iterator)3 List (java.util.List)3 SVNRevision (org.tigris.subversion.svnclientadapter.SVNRevision)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 IToolBarManager (org.eclipse.jface.action.IToolBarManager)2 Document (org.eclipse.jface.text.Document)2 ISelection (org.eclipse.jface.viewers.ISelection)2 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)2 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2