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) |
| Modifier and Type | Method and Description |
|---|---|
RevCommit |
call()
Executes the
revert command with all the options and parameters
collected by the setter methods (e.g. |
MergeResult |
getFailingResult() |
List<Ref> |
getRevertedRefs() |
List<String> |
getUnmergedPaths() |
RevertCommand |
include(AnyObjectId commit) |
RevertCommand |
include(Ref commit) |
RevertCommand |
include(String name,
AnyObjectId commit) |
RevertCommand |
setOurCommitName(String ourCommitName) |
RevertCommand |
setStrategy(MergeStrategy strategy) |
checkCallable, getRepository, setCallableprotected RevertCommand(Repository repo)
repo - public RevCommit call() throws NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, GitAPIException
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>RevCommit pointed to by the new HEAD is
returned. If a failure occurred during revert null
is returned. The list of successfully reverted Ref's can
be obtained by calling getRevertedRefs()GitAPIExceptionWrongRepositoryStateExceptionConcurrentRefUpdateExceptionUnmergedPathsExceptionNoMessageExceptionpublic RevertCommand include(Ref commit)
commit - a reference to a commit which is reverted into the current
headthispublic RevertCommand include(AnyObjectId commit)
commit - the Id of a commit which is reverted into the current headthispublic RevertCommand include(String name, AnyObjectId commit)
name - a name given 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. 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 during this revert command.thisCopyright © 2014. All rights reserved.