public class StrategyOneSided extends MergeStrategy
This strategy can be used to cauterize an entire side branch of history, by setting the output tree to one of the inputs, and ignoring any of the paths of the other inputs.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
StrategyOneSided.OneSide |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
strategyName |
private int |
treeIndex |
OURS, RECURSIVE, RESOLVE, SIMPLE_TWO_WAY_IN_CORE, THEIRS
Modifier | Constructor and Description |
---|---|
protected |
StrategyOneSided(java.lang.String name,
int index)
Create a new merge strategy to select a specific input tree.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Get default name of this strategy implementation.
|
Merger |
newMerger(ObjectInserter inserter,
Config config)
Create a new merge instance.
|
Merger |
newMerger(Repository db)
Create a new merge instance.
|
Merger |
newMerger(Repository db,
boolean inCore)
Create a new merge instance.
|
get, get, register, register
private final java.lang.String strategyName
private final int treeIndex
protected StrategyOneSided(java.lang.String name, int index)
name
- name of this strategy.index
- the position of the input tree to accept as the result.public java.lang.String getName()
getName
in class MergeStrategy
public Merger newMerger(Repository db)
newMerger
in class MergeStrategy
db
- repository database the merger will read from, and eventually
write results back to.public Merger newMerger(Repository db, boolean inCore)
newMerger
in class MergeStrategy
db
- repository database the merger will read from, and eventually
write results back to.inCore
- the merge will happen in memory, working folder will not be
modified, in case of a non-trivial merge that requires manual
resolution, the merger will fail.public Merger newMerger(ObjectInserter inserter, Config config)
The merge will happen in memory, working folder will not be modified, in case of a non-trivial merge that requires manual resolution, the merger will fail.
newMerger
in class MergeStrategy
inserter
- inserter to write results back to.config
- repo config for reading diff algorithm settings.