org.eclipse.jgit.merge
Class StrategyOneSided

java.lang.Object
  extended by org.eclipse.jgit.merge.MergeStrategy
      extended by org.eclipse.jgit.merge.StrategyOneSided

public class StrategyOneSided
extends MergeStrategy

Trivial merge strategy to make the resulting tree exactly match an input.

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.


Field Summary
 
Fields inherited from class org.eclipse.jgit.merge.MergeStrategy
OURS, RESOLVE, SIMPLE_TWO_WAY_IN_CORE, THEIRS
 
Constructor Summary
protected StrategyOneSided(String name, int index)
          Create a new merge strategy to select a specific input tree.
 
Method Summary
 String getName()
           
 Merger newMerger(Repository db)
          Create a new merge instance.
 Merger newMerger(Repository db, boolean inCore)
          Create a new merge instance.
 
Methods inherited from class org.eclipse.jgit.merge.MergeStrategy
get, get, register, register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrategyOneSided

protected StrategyOneSided(String name,
                           int index)
Create a new merge strategy to select a specific input tree.

Parameters:
name - name of this strategy.
index - the position of the input tree to accept as the result.
Method Detail

getName

public String getName()
Specified by:
getName in class MergeStrategy
Returns:
default name of this strategy implementation.

newMerger

public Merger newMerger(Repository db)
Description copied from class: MergeStrategy
Create a new merge instance.

Specified by:
newMerger in class MergeStrategy
Parameters:
db - repository database the merger will read from, and eventually write results back to.
Returns:
the new merge instance which implements this strategy.

newMerger

public Merger newMerger(Repository db,
                        boolean inCore)
Description copied from class: MergeStrategy
Create a new merge instance.

Specified by:
newMerger in class MergeStrategy
Parameters:
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.
Returns:
the new merge instance which implements this strategy.


Copyright © 2012. All Rights Reserved.