public class ResolveMerger extends ThreeWayMerger
| Modifier and Type | Class and Description |
|---|---|
static class |
ResolveMerger.MergeFailureReason
If the merge fails (means: not stopped because of unresolved conflicts)
this enum is used to explain why it failed
|
| Modifier and Type | Field and Description |
|---|---|
protected String[] |
commitNames
string versions of a list of commit SHA1s
|
protected DirCache |
dircache
Directory cache
|
protected boolean |
implicitDirCache
Set to true if this merger should use the default dircache of the
repository and should handle locking and unlocking of the dircache.
|
protected boolean |
inCore
Set to true if this merge should work in-memory.
|
protected MergeAlgorithm |
mergeAlgorithm
our merge algorithm
|
protected ObjectId |
resultTree
merge result as tree
|
protected WorkingTreeIterator |
workingTreeIterator
The iterator to access the working tree.
|
db, reader, sourceCommits, sourceObjects, sourceTrees, walk| Modifier | Constructor and Description |
|---|---|
protected |
ResolveMerger(Repository local) |
protected |
ResolveMerger(Repository local,
boolean inCore) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
failed()
Returns whether this merge failed (i.e.
|
String[] |
getCommitNames() |
Map<String,ResolveMerger.MergeFailureReason> |
getFailingPaths() |
Map<String,MergeResult<? extends Sequence>> |
getMergeResults() |
List<String> |
getModifiedFiles() |
ObjectId |
getResultTreeId() |
Map<String,DirCacheEntry> |
getToBeCheckedOut() |
List<String> |
getUnmergedPaths() |
protected boolean |
mergeImpl()
Execute the merge.
|
protected boolean |
mergeTrees(AbstractTreeIterator baseTree,
RevTree headTree,
RevTree mergeTree)
The resolve conflict way of three way merging
|
void |
setCommitNames(String[] commitNames) |
void |
setDirCache(DirCache dc)
Sets the DirCache which shall be used by this merger.
|
void |
setWorkingTreeIterator(WorkingTreeIterator workingTreeIterator)
Sets the WorkingTreeIterator to be used by this merger.
|
merge, mergeBase, setBasegetBaseCommit, getBaseCommit, getObjectInserter, getRepository, mergeBase, openTree, setObjectInserterprotected String[] commitNames
protected ObjectId resultTree
protected boolean inCore
protected boolean implicitDirCache
protected DirCache dircache
protected WorkingTreeIterator workingTreeIterator
null this
merger will not touch the working tree.protected MergeAlgorithm mergeAlgorithm
protected ResolveMerger(Repository local, boolean inCore)
local - inCore - protected ResolveMerger(Repository local)
local - protected boolean mergeImpl()
throws IOException
Merger
This method is called from Merger.merge(AnyObjectId[]) after the
Merger.sourceObjects, Merger.sourceCommits and Merger.sourceTrees
have been populated.
mergeImpl in class MergerIncorrectObjectTypeException - one of the input objects is not a commit, but the strategy
requires it to be a commit.IOException - one or more sources could not be read, or outputs could not
be written to the Repository.public ObjectId getResultTreeId()
getResultTreeId in class MergerMerger.merge(AnyObjectId[]) returned true.public void setCommitNames(String[] commitNames)
commitNames - the names of the commits as they would appear in conflict
markerspublic String[] getCommitNames()
public List<String> getUnmergedPaths()
getModifiedFiles()public List<String> getModifiedFiles()
getUnmergedPaths().public Map<String,DirCacheEntry> getToBeCheckedOut()
public Map<String,MergeResult<? extends Sequence>> getMergeResults()
public Map<String,ResolveMerger.MergeFailureReason> getFailingPaths()
null is returned if this merge didn't
fail.public boolean failed()
true if a failure occurred, false
otherwisepublic void setDirCache(DirCache dc)
DirCache.commit() which requires that the
DirCache is locked. If the mergeImpl() returns without throwing
an exception the lock will be released. In case of exceptions the caller
is responsible to release the lock.dc - the DirCache to setpublic void setWorkingTreeIterator(WorkingTreeIterator workingTreeIterator)
TODO: enhance WorkingTreeIterator to support write operations. Then this merger will be able to merge with a different working tree abstraction.
workingTreeIterator - the workingTreeIt to setprotected boolean mergeTrees(AbstractTreeIterator baseTree, RevTree headTree, RevTree mergeTree) throws IOException
baseTree - headTree - mergeTree - IOExceptionCopyright © 2013. All Rights Reserved.