Search in sources :

Example 1 with BranchTagPropertyUpdateDialog

use of org.tigris.subversion.subclipse.ui.dialogs.BranchTagPropertyUpdateDialog 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 2 with BranchTagPropertyUpdateDialog

use of org.tigris.subversion.subclipse.ui.dialogs.BranchTagPropertyUpdateDialog in project subclipse by subclipse.

the class BranchTagWizard method updateTagsProperty.

private void updateTagsProperty(SVNUrl toUrl) {
    ISVNClientAdapter svnClient = null;
    try {
        if (resources.length > 1)
            return;
        ISVNProperty property = null;
        // $NON-NLS-1$
        property = repositoryPage.getSvnResource().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(repositoryPage.getSvnResource().getRepository().getUrl().toString().length());
        newAlias.setRelativePath(relativePath);
        SVNRevision revision = null;
        if (copyPage.revisionButton.getSelection())
            revision = SVNRevision.getRevision(copyPage.getRevision());
        else {
            svnClient = repositoryPage.getSvnResource().getRepository().getSVNClient();
            ISVNInfo svnInfo = svnClient.getInfo(repositoryPage.getUrl());
            revision = SVNRevision.getRevision(svnInfo.getRevision().toString());
        }
        newAlias.setRevision(Integer.parseInt(revision.toString()));
        newAlias.setName(toUrl.getLastPathSegment());
        BranchTagPropertyUpdateDialog dialog = new BranchTagPropertyUpdateDialog(getShell(), getResource(), newAlias, // $NON-NLS-1$
        "BranchTagPropertyUpdateDialog");
        if (dialog.open() == BranchTagPropertyUpdateDialog.OK)
            newAlias = dialog.getNewAlias();
        else
            newAlias = null;
    } catch (Exception e) {
    } finally {
        if (svnClient != null) {
            repositoryPage.getSvnResource().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) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Aggregations

Alias (org.tigris.subversion.subclipse.core.history.Alias)2 BranchTagPropertyUpdateDialog (org.tigris.subversion.subclipse.ui.dialogs.BranchTagPropertyUpdateDialog)2 ISVNClientAdapter (org.tigris.subversion.svnclientadapter.ISVNClientAdapter)2 ISVNInfo (org.tigris.subversion.svnclientadapter.ISVNInfo)2 ISVNProperty (org.tigris.subversion.svnclientadapter.ISVNProperty)2 SVNRevision (org.tigris.subversion.svnclientadapter.SVNRevision)2 SVNException (org.tigris.subversion.subclipse.core.SVNException)1