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

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

Introduction

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

Prototype

public List<Ref> getRevertedRefs() 

Source Link

Document

Get the list of successfully reverted org.eclipse.jgit.lib.Ref 's.

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  ww  . ja  v  a2 s.co  m
            pm.worked(1);

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

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