Class RevertCommand
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MergeResultprivate ProgressMonitorprivate Stringprivate MergeStrategyFields inherited from class GitCommand
repo -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRevertCommand(Repository repo) Constructor for RevertCommand. -
Method Summary
Modifier and TypeMethodDescriptionprivate StringcalculateOurName(Ref headRef) call()Get the result of a merge failureGet the list of successfully revertedRef's.Get unmerged pathsinclude(String name, AnyObjectId commit) Include a commit to be revertedinclude(AnyObjectId commit) Include a commit to be revertedInclude aRefto a commit to be revertedsetOurCommitName(String ourCommitName) Set the name to be used in the "OURS" place for conflict markerssetProgressMonitor(ProgressMonitor monitor) The progress monitor associated with the revert operation.setStrategy(MergeStrategy strategy) Set the merge strategy to use for this revert commandMethods inherited from class GitCommand
checkCallable, getRepository, setCallable
-
Field Details
-
commits
-
ourCommitName
-
revertedRefs
-
failingResult
-
unmergedPaths
-
strategy
-
monitor
-
-
Constructor Details
-
RevertCommand
Constructor for RevertCommand.
- Parameters:
repo- theRepository
-
-
Method Details
-
call
public RevCommit call() throws NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, GitAPIExceptionExecute the command
Executes the
revertcommand 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.- Specified by:
callin interfaceCallable<RevCommit>- Specified by:
callin classGitCommand<RevCommit>- Throws:
NoMessageExceptionUnmergedPathsExceptionConcurrentRefUpdateExceptionWrongRepositoryStateExceptionGitAPIException
-
include
Include aRefto a commit to be reverted- Parameters:
commit- a reference to a commit to be reverted into the current head- Returns:
this
-
include
Include a commit to be reverted- Parameters:
commit- the Id of a commit to be reverted into the current head- Returns:
this
-
include
Include a commit to be reverted- Parameters:
name- name of aRefreferring to the commitcommit- the Id of a commit which is reverted into the current head- Returns:
this
-
setOurCommitName
Set the name to be used in the "OURS" place for conflict markers- Parameters:
ourCommitName- the name that should be used in the "OURS" place for conflict markers- Returns:
this
-
calculateOurName
-
getRevertedRefs
-
getFailingResult
Get the result of a merge failure- Returns:
- the result of a merge failure,
nullif no merge failure occurred during the revert
-
getUnmergedPaths
-
setStrategy
Set the merge strategy to use for this revert command- Parameters:
strategy- The merge strategy to use for this revert command.- Returns:
this- Since:
- 3.4
-
setProgressMonitor
The progress monitor associated with the revert operation. By default, this is set toNullProgressMonitor- Parameters:
monitor- aProgressMonitor- Returns:
this- Since:
- 4.11
- See Also:
-