Search in sources :

Example 1 with AliasManager

use of org.tigris.subversion.subclipse.core.history.AliasManager in project subclipse by subclipse.

the class BranchTagOperation method updateBranchTagProperty.

private void updateBranchTagProperty(IResource resource) {
    AliasManager aliasManager = new AliasManager(resource, false);
    Alias[] branchAliases = aliasManager.getBranches();
    Alias[] tagAliases = aliasManager.getTags();
    StringBuffer propertyValue = new StringBuffer();
    for (int i = 0; i < branchAliases.length; i++) {
        if (branchAliases[i].getRevision() > 0) {
            // $NON-NLS-1$
            if (propertyValue.length() > 0)
                propertyValue.append("\n");
            Alias branch = branchAliases[i];
            // $NON-NLS-1$
            propertyValue.append(branch.getRevision() + "," + branch.getName());
            if (branch.getRelativePath() != null)
                // $NON-NLS-1$
                propertyValue.append("," + branch.getRelativePath());
            if (// $NON-NLS-1$
            branch.isBranch())
                // $NON-NLS-1$
                propertyValue.append(",branch");
            else
                // $NON-NLS-1$
                propertyValue.append(",tag");
        }
    }
    for (int i = 0; i < tagAliases.length; i++) {
        if (tagAliases[i].getRevision() > 0) {
            // $NON-NLS-1$
            if (propertyValue.length() > 0)
                propertyValue.append("\n");
            Alias tag = tagAliases[i];
            // $NON-NLS-1$
            propertyValue.append(tag.getRevision() + "," + tag.getName());
            if (tag.getRelativePath() != null)
                // $NON-NLS-1$
                propertyValue.append("," + tag.getRelativePath());
            if (// $NON-NLS-1$
            tag.isBranch())
                // $NON-NLS-1$
                propertyValue.append(",branch");
            else
                // $NON-NLS-1$
                propertyValue.append(",tag");
        }
    }
    // $NON-NLS-1$
    if (propertyValue.length() > 0)
        propertyValue.append("\n");
    propertyValue.append(newAlias.getRevision() + "," + newAlias.getName() + "," + // $NON-NLS-1$ //$NON-NLS-2$
    newAlias.getRelativePath());
    if (// $NON-NLS-1$
    newAlias.isBranch())
        // $NON-NLS-1$
        propertyValue.append(",branch");
    else
        // $NON-NLS-1$
        propertyValue.append(",tag");
    ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
    try {
        // $NON-NLS-1$
        svnResource.setSvnProperty("subclipse:tags", propertyValue.toString(), false);
    } catch (SVNException e) {
    }
}
Also used : AliasManager(org.tigris.subversion.subclipse.core.history.AliasManager) Alias(org.tigris.subversion.subclipse.core.history.Alias) SVNException(org.tigris.subversion.subclipse.core.SVNException) ISVNLocalResource(org.tigris.subversion.subclipse.core.ISVNLocalResource)

Example 2 with AliasManager

use of org.tigris.subversion.subclipse.core.history.AliasManager in project subclipse by subclipse.

the class RemoteContentProvider method setResource.

public void setResource(IResource resource) {
    if (includeBranchesAndTags) {
        AliasManager tagManager = new AliasManager(resource);
        Alias[] branchAliases = tagManager.getBranches();
        Alias[] tagAliases = tagManager.getTags();
        if (branchAliases.length > 0)
            branches = new Branches(branchAliases);
        if (tagAliases.length > 0)
            tags = new Tags(tagAliases);
    }
}
Also used : AliasManager(org.tigris.subversion.subclipse.core.history.AliasManager) Alias(org.tigris.subversion.subclipse.core.history.Alias) Branches(org.tigris.subversion.subclipse.core.history.Branches) Tags(org.tigris.subversion.subclipse.core.history.Tags)

Example 3 with AliasManager

use of org.tigris.subversion.subclipse.core.history.AliasManager in project subclipse by subclipse.

the class MergeWizardUnblockRevisionsPage method getLogEntries.

private void getLogEntries() {
    entryArray = new ArrayList();
    IRunnableWithProgress runnable = new IRunnableWithProgress() {

        public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            try {
                monitor.setTaskName(Messages.MergeWizardUnblockRevisionsPage_retrievingRevisionLogInfo);
                monitor.beginTask(Messages.MergeWizardUnblockRevisionsPage_retrievingRevisionLogInfo, 3);
                if (SVNUIPlugin.getPlugin().getPreferenceStore().getBoolean(ISVNUIConstants.PREF_SHOW_TAGS_IN_REMOTE))
                    tagManager = new AliasManager(remoteResource.getUrl());
                SVNRevision pegRevision = remoteResource.getRevision();
                monitor.worked(1);
                for (int i = 0; i < revisionRanges.length; i++) {
                    rangeEntries = getLogEntries(pegRevision, revisionRanges[i].getFromRevision(), revisionRanges[i].getToRevision(), true, 0, tagManager, true);
                    monitor.worked(1);
                    for (int j = 0; j < rangeEntries.length; j++) {
                        entryArray.add(rangeEntries[j]);
                    }
                }
                entries = new ILogEntry[entryArray.size()];
                entryArray.toArray(entries);
            } catch (Exception e) {
                setErrorMessage(e.getMessage());
                entries = new ILogEntry[0];
            }
            monitor.worked(1);
            monitor.done();
        }
    };
    try {
        getContainer().run(false, false, runnable);
    } catch (Exception e1) {
        Activator.handleError(e1);
    }
    setErrorMessage(standardPage.getErrorMessage());
}
Also used : AliasManager(org.tigris.subversion.subclipse.core.history.AliasManager) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ILogEntry(org.tigris.subversion.subclipse.core.history.ILogEntry) ArrayList(java.util.ArrayList) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) Point(org.eclipse.swt.graphics.Point) InvocationTargetException(java.lang.reflect.InvocationTargetException) TeamException(org.eclipse.team.core.TeamException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Example 4 with AliasManager

use of org.tigris.subversion.subclipse.core.history.AliasManager in project subclipse by subclipse.

the class RevisionDetailsAction method run.

public void run() {
    remoteResource = null;
    logEntry = null;
    includeTags = SVNUIPlugin.getPlugin().getPreferenceStore().getBoolean(ISVNUIConstants.PREF_SHOW_TAGS_IN_REMOTE);
    BusyIndicator.showWhile(Display.getDefault(), new Runnable() {

        public void run() {
            try {
                RevisionGraphEditorInput input = (RevisionGraphEditorInput) editor.getEditorInput();
                ISVNInfo info = input.getInfo();
                ISVNRepositoryLocation repository = SVNProviderPlugin.getPlugin().getRepository(info.getRepository().toString());
                remoteResource = new RemoteFile(repository, new SVNUrl(repository.getLocation() + node.getPath()), new SVNRevision.Number(node.getRevision()));
                AliasManager tagManager = null;
                if (includeTags)
                    tagManager = new AliasManager(remoteResource.getUrl());
                SVNRevision pegRevision = new SVNRevision.Number(node.getRevision());
                SVNRevision revisionStart = new SVNRevision.Number(node.getRevision());
                SVNRevision revisionEnd = new SVNRevision.Number(node.getRevision());
                GetLogsCommand logCmd = new GetLogsCommand(remoteResource, pegRevision, revisionStart, revisionEnd, false, 0, tagManager, true);
                logCmd.run(null);
                ILogEntry[] logEntries = logCmd.getLogEntries();
                if (logEntries != null && logEntries.length > 0) {
                    logEntry = logEntries[0];
                }
            } catch (Exception e) {
                MessageDialog.openError(Display.getDefault().getActiveShell(), "Revision Info", e.getMessage());
            }
        }
    });
    if (logEntry != null) {
        ShowRevisionsDialog dialog = new ShowRevisionsDialog(Display.getDefault().getActiveShell(), logEntry, remoteResource, includeTags, null);
        dialog.setTitle("Revision Info");
        dialog.setSelectFirst(true);
        dialog.open();
    }
}
Also used : AliasManager(org.tigris.subversion.subclipse.core.history.AliasManager) ISVNRepositoryLocation(org.tigris.subversion.subclipse.core.ISVNRepositoryLocation) RevisionGraphEditorInput(org.tigris.subversion.subclipse.graph.editors.RevisionGraphEditorInput) SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) ShowRevisionsDialog(org.tigris.subversion.subclipse.ui.dialogs.ShowRevisionsDialog) GetLogsCommand(org.tigris.subversion.subclipse.core.commands.GetLogsCommand) ISVNInfo(org.tigris.subversion.svnclientadapter.ISVNInfo) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) RemoteFile(org.tigris.subversion.subclipse.core.resources.RemoteFile)

Example 5 with AliasManager

use of org.tigris.subversion.subclipse.core.history.AliasManager in project subclipse by subclipse.

the class SvnWizardConfigureTagsPage method getBranchesAndTags.

private void getBranchesAndTags() {
    AliasManager aliasManager = new AliasManager(svnResources[0].getResource(), false);
    Alias[] branchAliases = aliasManager.getBranches();
    branches = new Branches(branchAliases);
    Alias[] tagAliases = aliasManager.getTags();
    tags = new Tags(tagAliases);
}
Also used : AliasManager(org.tigris.subversion.subclipse.core.history.AliasManager) Alias(org.tigris.subversion.subclipse.core.history.Alias) Branches(org.tigris.subversion.subclipse.core.history.Branches) Tags(org.tigris.subversion.subclipse.core.history.Tags)

Aggregations

AliasManager (org.tigris.subversion.subclipse.core.history.AliasManager)7 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)3 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)3 TeamException (org.eclipse.team.core.TeamException)3 SVNException (org.tigris.subversion.subclipse.core.SVNException)3 Alias (org.tigris.subversion.subclipse.core.history.Alias)3 ILogEntry (org.tigris.subversion.subclipse.core.history.ILogEntry)3 ISVNLocalResource (org.tigris.subversion.subclipse.core.ISVNLocalResource)2 GetLogsCommand (org.tigris.subversion.subclipse.core.commands.GetLogsCommand)2 Branches (org.tigris.subversion.subclipse.core.history.Branches)2 Tags (org.tigris.subversion.subclipse.core.history.Tags)2 SVNRevision (org.tigris.subversion.svnclientadapter.SVNRevision)2 MalformedURLException (java.net.MalformedURLException)1 ArrayList (java.util.ArrayList)1 IFile (org.eclipse.core.resources.IFile)1 IResource (org.eclipse.core.resources.IResource)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Point (org.eclipse.swt.graphics.Point)1 SaveablePartDialog (org.eclipse.team.ui.SaveablePartDialog)1