use of org.eclipse.egit.ui.internal.commit.RepositoryCommit in project egit by eclipse.
the class BlameInformationControl method openCommit.
private void openCommit() {
try {
getShell().dispose();
CommitEditor.open(new RepositoryCommit(revision.getRepository(), revision.getCommit()));
} catch (PartInitException pie) {
Activator.logError(pie.getLocalizedMessage(), pie);
}
}
use of org.eclipse.egit.ui.internal.commit.RepositoryCommit in project egit by eclipse.
the class CheckoutHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final List<RepositoryCommit> commits = getCommits(event);
if (commits.size() == 1) {
final RepositoryCommit commit = commits.get(0);
BranchOperationUI.checkout(commit.getRepository(), commit.getRevCommit().name()).start();
}
return null;
}
use of org.eclipse.egit.ui.internal.commit.RepositoryCommit in project egit by eclipse.
the class CreateBranchHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RepositoryCommit> commits = getCommits(event);
if (commits.size() == 1) {
RepositoryCommit commit = commits.get(0);
WizardDialog dlg = new WizardDialog(HandlerUtil.getActiveShellChecked(event), new CreateBranchWizard(commit.getRepository(), commit.getRevCommit().name()));
dlg.setHelpAvailable(false);
dlg.open();
}
return null;
}
use of org.eclipse.egit.ui.internal.commit.RepositoryCommit in project egit by eclipse.
the class CreateTagHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
List<RepositoryCommit> commits = getCommits(event);
if (commits.size() == 1) {
RepositoryCommit commit = commits.get(0);
Repository repository = commit.getRepository();
CreateTagDialog dialog = new CreateTagDialog(HandlerUtil.getActiveShellChecked(event), commit.getRevCommit().getId(), repository);
if (dialog.open() != Window.OK)
return null;
final TagBuilder tag = new TagBuilder();
PersonIdent personIdent = new PersonIdent(repository);
String tagName = dialog.getTagName();
tag.setTag(tagName);
tag.setTagger(personIdent);
tag.setMessage(dialog.getTagMessage());
tag.setObjectId(commit.getRevCommit());
try {
new TagOperation(repository, tag, dialog.shouldOverWriteTag()).execute(new NullProgressMonitor());
} catch (CoreException e) {
throw new ExecutionException(e.getMessage(), e);
}
if (dialog.shouldStartPushWizard())
PushTagsWizard.openWizardDialog(repository, tagName);
}
return null;
}
use of org.eclipse.egit.ui.internal.commit.RepositoryCommit in project egit by eclipse.
the class ShowInHistoryHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
List<RepositoryCommit> commits = getCommits(event);
if (commits.size() == 1) {
RepositoryCommit repoCommit = commits.get(0);
try {
IHistoryView view = (IHistoryView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IHistoryView.VIEW_ID);
view.showHistoryFor(repoCommit);
} catch (PartInitException e) {
throw new ExecutionException(e.getMessage(), e);
}
}
return null;
}
Aggregations