Example usage for org.eclipse.jgit.api RevertCommand getFailingResult

List of usage examples for org.eclipse.jgit.api RevertCommand getFailingResult

Introduction

In this page you can find the example usage for org.eclipse.jgit.api RevertCommand getFailingResult.

Prototype

public MergeResult getFailingResult() 

Source Link

Document

Get the result of a merge failure

Usage

From source file:org.eclipse.egit.core.op.RevertCommitOperation.java

License:Open Source License

public void execute(IProgressMonitor m) throws CoreException {
    IProgressMonitor monitor = m != null ? m : new NullProgressMonitor();
    IWorkspaceRunnable action = new IWorkspaceRunnable() {

        public void run(IProgressMonitor pm) throws CoreException {
            pm.beginTask("", 2); //$NON-NLS-1$

            pm.subTask(MessageFormat.format(CoreText.RevertCommitOperation_reverting, commit.name()));
            RevertCommand command = new Git(repo).revert().include(commit);
            try {
                newHead = command.call();
                reverted = command.getRevertedRefs();
                result = command.getFailingResult();
            } catch (GitAPIException e) {
                throw new TeamException(e.getLocalizedMessage(), e.getCause());
            }/*from w w w . j a  v a  2 s .co m*/
            pm.worked(1);

            ProjectUtil.refreshValidProjects(ProjectUtil.getValidOpenProjects(repo),
                    new SubProgressMonitor(pm, 1));

            pm.done();
        }
    };
    ResourcesPlugin.getWorkspace().run(action, monitor);
}