use of org.tigris.subversion.svnclientadapter.ISVNInfo in project subclipse by subclipse.
the class CommitOperation method getSVNInfo.
private ISVNInfo getSVNInfo(ISVNLocalResource localResource) {
if (!atomicCommit)
return null;
if (localResource == null)
return null;
File file = localResource.getFile();
if (file == null)
return null;
boolean returnSVNClient = svnClient == null;
if (svnClient == null) {
try {
svnClient = SVNProviderPlugin.getPlugin().getSVNClientManager().getSVNClient();
} catch (SVNException e) {
return null;
}
}
ISVNInfo info;
try {
SVNProviderPlugin.disableConsoleLogging();
info = svnClient.getInfoFromWorkingCopy(file);
SVNProviderPlugin.enableConsoleLogging();
} catch (SVNClientException e) {
SVNProviderPlugin.enableConsoleLogging();
return null;
} finally {
if (returnSVNClient) {
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(svnClient);
}
}
return info;
}
use of org.tigris.subversion.svnclientadapter.ISVNInfo in project subclipse by subclipse.
the class CommitOperation method getRootURL.
private String getRootURL(ISVNLocalResource localResource) {
if (!atomicCommit)
return null;
ISVNInfo info = getSVNInfo(localResource);
if (info == null)
return null;
SVNUrl repos = info.getRepository();
if (repos == null)
return null;
return repos.toString();
}
use of org.tigris.subversion.svnclientadapter.ISVNInfo in project subclipse by subclipse.
the class BranchTagWizard method performFinish.
public boolean performFinish() {
if (confirmUserData() == false) {
return false;
}
svnExternals = copyPage.getSvnExternals();
comment = commentPage.getComment();
repositoryPage.saveUrl();
createOnServer = !copyPage.workingCopyButton.getSelection();
makeParents = repositoryPage.makeParentsButton.getSelection();
sameStructure = repositoryPage.sameStructureButton != null && repositoryPage.sameStructureButton.getSelection();
if (commentPage.switchAfterBranchTagCheckBox != null) {
switchAfterBranchTag = commentPage.switchAfterBranchTagCheckBox.getSelection();
}
if (copyPage.serverButton.getSelection())
revision = SVNRevision.HEAD;
try {
toUrl = new SVNUrl(repositoryPage.getToUrl());
if (copyPage.revisionButton.getSelection())
revision = SVNRevision.getRevision(copyPage.getRevision());
} catch (Exception e) {
MessageDialog.openError(getShell(), Policy.bind("BranchTagDialog.title"), // $NON-NLS-1$
e.getMessage());
return false;
}
if (!multipleSelections()) {
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
public void run() {
ISVNInfo svnInfo = null;
SVNUrl[] sourceUrls = getUrls();
ISVNClientAdapter svnClient = null;
ISVNRepositoryLocation repository = null;
try {
SVNProviderPlugin.disableConsoleLogging();
repository = SVNProviderPlugin.getPlugin().getRepository(sourceUrls[0].toString());
svnClient = repository.getSVNClient();
svnInfo = svnClient.getInfo(toUrl);
} catch (Exception e) {
} finally {
SVNProviderPlugin.enableConsoleLogging();
if (repository != null) {
repository.returnSVNClient(svnClient);
}
}
alreadyExists = svnInfo != null;
}
});
if (alreadyExists) {
MessageDialog.openError(getShell(), Policy.bind("BranchTagDialog.title"), Policy.bind("BranchTagDialog.alreadyExists", // $NON-NLS-1$ //$NON-NLS-2$
toUrl.toString()));
return false;
}
}
if (resources != null)
updateTagsProperty(toUrl);
return true;
}
use of org.tigris.subversion.svnclientadapter.ISVNInfo in project subclipse by subclipse.
the class SVNWorkspaceRoot method setSharing.
/**
* Set the sharing for a project to enable it to be used with the SVNTeamProvider. This is used
* when a project has .svn directory but is not shared in Eclipse. An exception is thrown if
* project does not have a remote directory counterpart
*/
public static void setSharing(IProject project, IProgressMonitor monitor) throws TeamException {
// Ensure provided info matches that of the project
LocalResourceStatus status = peekResourceStatusFor(project);
// we will change this exception !
if (!status.hasRemote())
throw new SVNException(new SVNStatus(IStatus.ERROR, // $NON-NLS-1$
Policy.bind("SVNProvider.infoMismatch", project.getName())));
String repositoryURL = null;
ISVNClientAdapter client = SVNProviderPlugin.getPlugin().getSVNClient();
try {
SVNProviderPlugin.disableConsoleLogging();
ISVNInfo info = client.getInfoFromWorkingCopy(project.getLocation().toFile());
if (info.getRepository() != null)
repositoryURL = info.getRepository().toString();
} catch (SVNClientException e) {
} finally {
SVNProviderPlugin.enableConsoleLogging();
SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
}
if (repositoryURL == null)
repositoryURL = status.getUrlString();
// Ensure that the provided location is managed
SVNProviderPlugin.getPlugin().getRepositories().getRepository(repositoryURL, false);
// Register the project with Team
RepositoryProvider.map(project, SVNProviderPlugin.getTypeId());
}
use of org.tigris.subversion.svnclientadapter.ISVNInfo 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();
}
}
Aggregations