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;
}
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;
}
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();
}
}
}
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;
}
}
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);
}
}
}
Aggregations