Search in sources :

Example 36 with SVNUrl

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

the class MergeWizardAdvancedPage method getUrl.

private String getUrl(String url) {
    if (url != null) {
        try {
            SVNUrlWithPegRevision svnUrlWithPegRevision = new SVNUrlWithPegRevision(new SVNUrl(url));
            SVNUrl svnUrl = svnUrlWithPegRevision.getUrl();
            if (svnUrl != null)
                return svnUrl.toString();
        } catch (MalformedURLException e) {
        }
    }
    return url;
}
Also used : MalformedURLException(java.net.MalformedURLException) SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) SVNUrlWithPegRevision(org.tigris.subversion.subclipse.core.util.SVNUrlWithPegRevision)

Example 37 with SVNUrl

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

the class RemoteAnnotationStorage method getFullPath.

/*
   * (non-Javadoc)
   * @see org.eclipse.core.resources.IStorage#getFullPath()
   */
public IPath getFullPath() {
    ISVNRepositoryLocation location = file.getRepository();
    SVNUrl repositoryUrl = location.getRepositoryRoot();
    String[] segments = repositoryUrl.getPathSegments();
    IPath path = new Path(null, "/");
    for (int i = 0; i < segments.length; i++) {
        path = path.append(segments[i]);
    }
    path = path.setDevice(repositoryUrl.getHost() + IPath.DEVICE_SEPARATOR);
    path = path.append(file.getRepositoryRelativePath());
    return path;
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) ISVNRepositoryLocation(org.tigris.subversion.subclipse.core.ISVNRepositoryLocation) IPath(org.eclipse.core.runtime.IPath) SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl)

Example 38 with SVNUrl

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

the class MergeAction method execute.

protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
    if (action != null && !action.isEnabled()) {
        action.setEnabled(true);
    } else {
        IResource[] resources = getSelectedResources();
        for (int i = 0; i < resources.length; i++) {
            MergeDialog dialog = new MergeDialog(getShell(), resources[i]);
            if (dialog.open() == MergeDialog.CANCEL)
                break;
            SVNUrl svnUrl1 = dialog.getFromUrl();
            SVNRevision svnRevision1 = dialog.getFromRevision();
            SVNUrl svnUrl2 = dialog.getToUrl();
            SVNRevision svnRevision2 = dialog.getToRevision();
            MergeOperation mergeOperation = new MergeOperation(getTargetPart(), getSelectedResources(), svnUrl1, svnRevision1, svnUrl2, svnRevision2);
            mergeOperation.setForce(dialog.isForce());
            mergeOperation.setIgnoreAncestry(dialog.isIgnoreAncestry());
            mergeOperation.run();
        }
    }
}
Also used : MergeOperation(org.tigris.subversion.subclipse.ui.operations.MergeOperation) SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) MergeDialog(org.tigris.subversion.subclipse.ui.dialogs.MergeDialog) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) IResource(org.eclipse.core.resources.IResource)

Example 39 with SVNUrl

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

the class RemoteResourceTransfer method fromByteArray.

public Object fromByteArray(byte[] buffer) {
    try {
        ByteArrayInputStream in = new ByteArrayInputStream(buffer);
        DataInputStream readIn = new DataInputStream(in);
        boolean isFolder = readIn.readBoolean();
        // first, we read the url of the remote resource
        SVNUrl urlResource = new SVNUrl(readIn.readUTF());
        // then we read the url of the repository
        String location = readIn.readUTF();
        // we read the revision
        SVNRevision revision = SVNRevision.getRevision(readIn.readUTF());
        // we read the last changed revision
        SVNRevision.Number lastChangedRevision = (Number) SVNRevision.getRevision(readIn.readUTF());
        Date date = new Date(readIn.readLong());
        String author = null;
        try {
            author = readIn.readUTF();
        } catch (Exception e) {
        // Ignore null author
        }
        ISVNRepositoryLocation repositoryLocation = SVNProviderPlugin.getPlugin().getRepository(location);
        if (isFolder) {
            return new RemoteFolder(null, repositoryLocation, urlResource, revision, lastChangedRevision, date, author);
        }
        return new RemoteFile(null, repositoryLocation, urlResource, revision, lastChangedRevision, date, author);
    } catch (Exception ex) {
        return null;
    }
}
Also used : SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) RemoteFolder(org.tigris.subversion.subclipse.core.resources.RemoteFolder) DataInputStream(java.io.DataInputStream) Date(java.util.Date) IOException(java.io.IOException) Number(org.tigris.subversion.svnclientadapter.SVNRevision.Number) ISVNRepositoryLocation(org.tigris.subversion.subclipse.core.ISVNRepositoryLocation) Number(org.tigris.subversion.svnclientadapter.SVNRevision.Number) ByteArrayInputStream(java.io.ByteArrayInputStream) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) RemoteFile(org.tigris.subversion.subclipse.core.resources.RemoteFile)

Example 40 with SVNUrl

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

the class RepositoryBranchTagAction method execute.

protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
    ISVNRemoteResource[] resources = getSelectedRemoteResources();
    BranchTagWizard wizard = new BranchTagWizard(resources);
    WizardDialog dialog = // $NON-NLS-1$
    new SizePersistedWizardDialog(getShell(), wizard, "BranchTag");
    if (dialog.open() == WizardDialog.OK) {
        SVNUrl[] sourceUrls = wizard.getUrls();
        SVNUrl destinationUrl = wizard.getToUrl();
        String message = wizard.getComment();
        SVNRevision revision = wizard.getRevision();
        boolean makeParents = wizard.isMakeParents();
        ISVNClientAdapter client = null;
        try {
            ISVNRepositoryLocation repository = SVNProviderPlugin.getPlugin().getRepository(sourceUrls[0].toString());
            if (repository != null)
                client = repository.getSVNClient();
            if (client == null)
                client = SVNProviderPlugin.getPlugin().getSVNClientManager().getSVNClient();
            RepositoryBranchTagOperation branchTagOperation = new RepositoryBranchTagOperation(getTargetPart(), client, sourceUrls, destinationUrl, revision, message, makeParents);
            branchTagOperation.setMultipleTransactions(wizard.isSameStructure());
            branchTagOperation.run();
        } catch (Exception e) {
            MessageDialog.openError(getShell(), Policy.bind("BranchTagDialog.title"), e.getMessage());
        } finally {
        // BranchTagCommand will dispose.
        // SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
        }
    }
}
Also used : SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) RepositoryBranchTagOperation(org.tigris.subversion.subclipse.ui.operations.RepositoryBranchTagOperation) ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) InvocationTargetException(java.lang.reflect.InvocationTargetException) TeamException(org.eclipse.team.core.TeamException) ISVNRepositoryLocation(org.tigris.subversion.subclipse.core.ISVNRepositoryLocation) BranchTagWizard(org.tigris.subversion.subclipse.ui.wizards.BranchTagWizard) SizePersistedWizardDialog(org.tigris.subversion.subclipse.ui.wizards.SizePersistedWizardDialog) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) WizardDialog(org.eclipse.jface.wizard.WizardDialog) SizePersistedWizardDialog(org.tigris.subversion.subclipse.ui.wizards.SizePersistedWizardDialog) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

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