* Handler to blame a path on a selected commit
*/
public class ShowBlameHandler extends AbstractHistoryCommandHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
GitHistoryPage page = getPage(event);
Object input = page.getInputInternal().getSingleItem();
if (input == null)
return null;
Repository repo = getRepository(event);
if (repo == null)
return null;
String path = getPath(repo, page);
if (path == null)
return null;
RevCommit commit = getSelectedCommit(event);
if (commit == null)
return null;
try {
IFileRevision revision = CompareUtils.getFileRevision(path, commit,
repo, null);
if (revision == null)
return null;
IStorage storage = revision.getStorage(new NullProgressMonitor());
BlameOperation op = new BlameOperation(repo, storage, path, commit,
HandlerUtil.getActiveShell(event), page.getSite().getPage());
JobUtil.scheduleUserJob(op, UIText.ShowBlameHandler_JobName,
JobFamilies.BLAME);
} catch (IOException e) {
Activator.showError(UIText.ShowBlameHandler_errorMessage, e);
} catch (CoreException e) {