public class RevertCommand extends GitCommand<RevCommit>
revert command. It has setters for all
supported options and arguments of this command and a call() method
to finally execute the command. Each instance of this class should only be
used for one invocation of the command (means: one call to call())repo| Modifier | Constructor and Description |
|---|---|
protected |
RevertCommand(Repository repo)
Constructor for RevertCommand.
|
| Modifier and Type | Method and Description |
|---|---|
RevCommit |
call() |
MergeResult |
getFailingResult()
Get the result of a merge failure
|
List<Ref> |
getRevertedRefs()
Get the list of successfully reverted
Ref's. |
List<String> |
getUnmergedPaths()
Get unmerged paths
|
RevertCommand |
include(AnyObjectId commit)
Include a commit to be reverted
|
RevertCommand |
include(Ref commit)
Include a
Ref to a commit to be reverted |
RevertCommand |
include(String name,
AnyObjectId commit)
Include a commit to be reverted
|
RevertCommand |
setOurCommitName(String ourCommitName)
Set the name to be used in the "OURS" place for conflict markers
|
RevertCommand |
setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the revert operation.
|
RevertCommand |
setStrategy(MergeStrategy strategy)
Set the merge strategy to use for this revert command
|
checkCallable, getRepository, setCallableprotected RevertCommand(Repository repo)
Constructor for RevertCommand.
repo - the Repositorypublic RevCommit call() throws NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, GitAPIException
Execute the command
Executes the revert command with all the options and parameters
collected by the setter methods (e.g. include(Ref) of this
class. Each instance of this class should only be used for one invocation
of the command. Don't call this method twice on an instance.
call in interface Callable<RevCommit>call in class GitCommand<RevCommit>NoMessageExceptionUnmergedPathsExceptionConcurrentRefUpdateExceptionWrongRepositoryStateExceptionGitAPIExceptionpublic RevertCommand include(Ref commit)
Ref to a commit to be revertedcommit - a reference to a commit to be reverted into the current headthispublic RevertCommand include(AnyObjectId commit)
commit - the Id of a commit to be reverted into the current headthispublic RevertCommand include(String name, AnyObjectId commit)
name - name of a Ref referring to the commitcommit - the Id of a commit which is reverted into the current headthispublic RevertCommand setOurCommitName(String ourCommitName)
ourCommitName - the name that should be used in the "OURS" place for conflict
markersthispublic List<Ref> getRevertedRefs()
Ref's.Ref's. Never null but
maybe an empty list if no commit was successfully cherry-pickedpublic MergeResult getFailingResult()
null if no merge
failure occurred during the revertpublic List<String> getUnmergedPaths()
public RevertCommand setStrategy(MergeStrategy strategy)
strategy - The merge strategy to use for this revert command.thispublic RevertCommand setProgressMonitor(ProgressMonitor monitor)
NullProgressMonitormonitor - a ProgressMonitorthisNullProgressMonitorCopyright © 2018 Eclipse JGit Project. All rights reserved.