Different strategies may employ different techniques for deciding which paths (and ObjectIds) to carry from the input trees into the final output tree.
| Modifier and Type | Field and Description |
|---|---|
| public static final MergeStrategy | OURS
Simple strategy that sets the output tree to the first input tree. |
| public static final ThreeWayMergeStrategy | RECURSIVE
Recursive strategy to merge paths. |
| public static final ThreeWayMergeStrategy | RESOLVE
Simple strategy to merge paths. |
| public static final ThreeWayMergeStrategy | SIMPLE_TWO_WAY_IN_CORE
Simple strategy to merge paths, without simultaneous edits. |
| private static final HashMap | |
| public static final MergeStrategy | THEIRS
Simple strategy that sets the output tree to the second input tree. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static synchronized MergeStrategy | |
| public static synchronized MergeStrategy[] | Returns: the registered strategy instances. No inherit order is returned; the caller may modify (and/or sort) the returned array if necessary to obtain a reasonable ordering.Get all registered strategies. |
| public abstract String | Returns: default name of this strategy implementation.Get default name of this strategy implementation. |
| public abstract Merger | Returns: the new merge instance which implements this strategy.repository database the merger will read from, and eventually
write results back to. db)Create a new merge instance. |
| public abstract Merger | Returns: the new merge instance which implements this strategy.repository database the merger will read from, and eventually
write results back to. db, boolean 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. inCore)Create a new merge instance. |
| public abstract Merger | Returns: the new merge instance which implements this strategy.inserter to write results back to. inserter, Config repo config for reading diff algorithm settings. config)Create a new merge instance. |
| public static void | register(MergeStrategy
the strategy to register. imp)Register a merge strategy so it can later be obtained by name. |
| public static synchronized void | register(final String
name the strategy can be looked up under. name, final MergeStrategy the strategy to register. imp)Register a merge strategy so it can later be obtained by name. |
| OURS | back to summary |
|---|---|
| public static final MergeStrategy OURS Simple strategy that sets the output tree to the first input tree. | |
| RECURSIVE | back to summary |
|---|---|
| public static final ThreeWayMergeStrategy RECURSIVE Recursive strategy to merge paths. It tries to merge also contents. Multiple merge bases are supported
| |
| RESOLVE | back to summary |
|---|---|
| public static final ThreeWayMergeStrategy RESOLVE Simple strategy to merge paths. It tries to merge also contents. Multiple merge bases are not supported | |
| SIMPLE_TWO_WAY_IN_CORE | back to summary |
|---|---|
| public static final ThreeWayMergeStrategy SIMPLE_TWO_WAY_IN_CORE Simple strategy to merge paths, without simultaneous edits. | |
| STRATEGIES | back to summary |
|---|---|
| private static final HashMap<String, MergeStrategy> STRATEGIES | |
| THEIRS | back to summary |
|---|---|
| public static final MergeStrategy THEIRS Simple strategy that sets the output tree to the second input tree. | |
| MergeStrategy | back to summary |
|---|---|
| public MergeStrategy() | |
| get | back to summary |
|---|---|
| public static synchronized MergeStrategy get(String name) Locate a strategy by name.
| |
| get | back to summary |
|---|---|
| public static synchronized MergeStrategy[] get() Get all registered strategies.
| |
| getName | back to summary |
|---|---|
| public abstract String getName() Get default name of this strategy implementation.
| |
| newMerger | back to summary |
|---|---|
| public abstract Merger newMerger(Repository db) Create a new merge instance.
| |
| newMerger | back to summary |
|---|---|
| public abstract Merger newMerger(Repository db, boolean inCore) Create a new merge instance.
| |
| newMerger | back to summary |
|---|---|
| public abstract Merger newMerger(ObjectInserter inserter, Config config) Create a new merge instance. 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.
| |
| register | back to summary |
|---|---|
| public static void register(MergeStrategy imp) Register a merge strategy so it can later be obtained by name.
| |
| register | back to summary |
|---|---|
| public static synchronized void register(final String name, final MergeStrategy imp) Register a merge strategy so it can later be obtained by name.
| |