|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jgit.merge.Merger
org.eclipse.jgit.merge.ThreeWayMerger
org.eclipse.jgit.merge.ResolveMerger
public class ResolveMerger
A three-way merger performing a content-merge if necessary
Nested Class Summary | |
---|---|
static class |
ResolveMerger.MergeFailureReason
If the merge fails (means: not stopped because of unresolved conflicts) this enum is used to explain why it failed |
Field Summary |
---|
Fields inherited from class org.eclipse.jgit.merge.Merger |
---|
db, reader, sourceCommits, sourceObjects, sourceTrees, walk |
Constructor Summary | |
---|---|
protected |
ResolveMerger(Repository local)
|
protected |
ResolveMerger(Repository local,
boolean inCore)
|
Method Summary | |
---|---|
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. |
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. |
Methods inherited from class org.eclipse.jgit.merge.ThreeWayMerger |
---|
merge, mergeBase, setBase |
Methods inherited from class org.eclipse.jgit.merge.Merger |
---|
getBaseCommit, getObjectInserter, getRepository, mergeBase, openTree, setObjectInserter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ResolveMerger(Repository local, boolean inCore)
local
- inCore
- protected ResolveMerger(Repository local)
local
- Method Detail |
---|
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 Merger
IncorrectObjectTypeException
- 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 Merger
Merger.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 set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |