use of org.tigris.subversion.subclipse.graph.editors.RevisionGraphEditorInput 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();
}
}
use of org.tigris.subversion.subclipse.graph.editors.RevisionGraphEditorInput in project subclipse by subclipse.
the class SetCommitPropertiesAction method run.
public void run() {
try {
IResource resource = ((RevisionGraphEditorInput) editor.getEditorInput()).getResource();
ISVNRemoteResource remoteResource = ((RevisionGraphEditorInput) editor.getEditorInput()).getRemoteResource();
ISVNInfo info = ((RevisionGraphEditorInput) editor.getEditorInput()).getInfo();
final ProjectProperties projectProperties = (resource != null) ? ProjectProperties.getProjectProperties(resource) : ProjectProperties.getProjectProperties(remoteResource);
SVNRevision.Number revision = new SVNRevision.Number(node.getRevision());
SetCommitPropertiesDialog dialog = new SetCommitPropertiesDialog(Display.getDefault().getActiveShell(), revision, resource, projectProperties);
dialog.setOldAuthor(node.getAuthor());
dialog.setOldComment(node.getMessage());
if (dialog.open() == SetCommitPropertiesDialog.OK) {
final String author;
final String commitComment;
if (node.getAuthor().equals(dialog.getAuthor()))
author = null;
else
author = dialog.getAuthor();
if (node.getMessage().equals(dialog.getComment()))
commitComment = null;
else
commitComment = dialog.getComment();
ISVNRepositoryLocation repository = SVNProviderPlugin.getPlugin().getRepository(info.getRepository().toString());
final ChangeCommitPropertiesCommand command = new ChangeCommitPropertiesCommand(repository, revision, commitComment, author);
PlatformUI.getWorkbench().getProgressService().run(true, true, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
command.run(monitor);
} catch (SVNException e) {
throw new InvocationTargetException(e);
} finally {
if (command.isAuthorChanged())
node.setAuthor(author);
if (command.isLogMessageChanged())
node.setMessage(commitComment);
if (command.isAuthorChanged() || command.isLogMessageChanged()) {
nodeFigure.setToolTip(new NodeTooltipFigure(node));
}
}
}
});
}
} catch (Exception e) {
SVNUIPlugin.openError(Display.getDefault().getActiveShell(), null, null, e, SVNUIPlugin.LOG_TEAM_EXCEPTIONS);
}
}
Aggregations