ilog.rules.teamserver.model
Class BranchHelper
- java.lang.Object
-
- ilog.rules.teamserver.model.BranchHelper
-
public class BranchHelper extends java.lang.Object
BranchHelper
handles branch specific operations.
-
-
Constructor Summary
Constructors Constructor and Description BranchHelper()
-
Method Summary
Methods Modifier and Type Method and Description static void
applyMerge(IlrSession session, java.util.List<MergeOperation> mergeOperations, java.lang.String versionComment)
Applies the merge operations defined in the list.protected static void
fillDependencies(IlrSession session, IlrBranch branch, java.util.Map<java.lang.String,IlrBranch> sortedDependencies)
static java.util.List<MergeOperation>
getConflicts(java.util.List<MergeOperation> mergeOperations)
static java.util.List<MergeOperation>
getLhsAdditions(java.util.List<MergeOperation> mergeOperations)
protected static IlrBaseline
getLhsBranch(java.util.List<MergeOperation> mergeOperations)
static java.util.List<MergeOperation>
getLhsDeletions(java.util.List<MergeOperation> mergeOperations)
static java.util.List<MergeOperation>
getLhsUpdates(java.util.List<MergeOperation> mergeOperations)
static java.util.List<MergeOperation>
getMergeOperations(IlrSession session, IlrBaseline lhsBranch, IlrBaseline rhsBranch)
Computes the list of differences between two branches.static java.util.Map<IlrBranch,java.util.List<MergeOperation>>
getMergeOperationsWithDep(IlrSession session, IlrBranch lhsBranch, IlrBranch rhsBranch)
Computes the list of differences between two branches and their dependencies.static java.util.List<MergeOperation>
getRhsAdditions(java.util.List<MergeOperation> mergeOperations)
protected static IlrBaseline
getRhsBranch(java.util.List<MergeOperation> mergeOperations)
static java.util.List<MergeOperation>
getRhsDeletions(java.util.List<MergeOperation> mergeOperations)
static java.util.List<MergeOperation>
getRhsUpdates(java.util.List<MergeOperation> mergeOperations)
-
-
-
Method Detail
-
getMergeOperations
public static java.util.List<MergeOperation> getMergeOperations(IlrSession session, IlrBaseline lhsBranch, IlrBaseline rhsBranch) throws IlrApplicationException
Computes the list of differences between two branches.- Throws:
IlrApplicationException
- Parameters:
session
- The session.lhsBranch
- The "Left-Hand-Side" branch of the comparison.rhsBranch
- The "Right-Hand-Side" branch of the comparison.- Returns:
- The list of differences.
-
getMergeOperationsWithDep
public static java.util.Map<IlrBranch,java.util.List<MergeOperation>> getMergeOperationsWithDep(IlrSession session, IlrBranch lhsBranch, IlrBranch rhsBranch) throws IlrApplicationException
Computes the list of differences between two branches and their dependencies. A conflict element is stored for the two branches (lhs and rhs).- Throws:
IlrApplicationException
- Parameters:
session
- The session.lhsBranch
- The "Left-Hand-Side" branch of the comparison.rhsBranch
- The "Right-Hand-Side" branch of the comparison.- Returns:
- The list of differences.
-
applyMerge
public static void applyMerge(IlrSession session, java.util.List<MergeOperation> mergeOperations, java.lang.String versionComment) throws IlrApplicationException
Applies the merge operations defined in the list. This list of operations is retrieved using thegetMergeOperations
method. Several operation lists retrieved by different calls togetMergeOperations
cannot be mixed and applied using a single call to this method. More specifically, all operations in the list should define the same Left-Hand-Side and Right-Hand-Side branches.- Throws:
IlrApplicationException
- Parameters:
session
- The session.mergeOperations
- A set of merge operations.versionComment
- A comment that will be used for each new element version created by this method.
-
getLhsAdditions
public static java.util.List<MergeOperation> getLhsAdditions(java.util.List<MergeOperation> mergeOperations)
- Parameters:
mergeOperations
- A set of merge operations.- Returns:
- A new list with all additions on the Left-Hand-Side branch.
-
getLhsDeletions
public static java.util.List<MergeOperation> getLhsDeletions(java.util.List<MergeOperation> mergeOperations)
- Parameters:
mergeOperations
- A set of merge operations.- Returns:
- A new list with all deletions on the Left-Hand-Side branch.
-
getLhsUpdates
public static java.util.List<MergeOperation> getLhsUpdates(java.util.List<MergeOperation> mergeOperations)
- Parameters:
mergeOperations
- A set of merge operations.- Returns:
- A new list with all updates on the Left-Hand-Side branch.
-
getRhsAdditions
public static java.util.List<MergeOperation> getRhsAdditions(java.util.List<MergeOperation> mergeOperations)
- Parameters:
mergeOperations
- A set of merge operations.- Returns:
- A new list with all additions on the Right-Hand-Side branch.
-
getRhsDeletions
public static java.util.List<MergeOperation> getRhsDeletions(java.util.List<MergeOperation> mergeOperations)
- Parameters:
mergeOperations
- A set of merge operations.- Returns:
- A new list with all deletions on the Right-Hand-Side branch.
-
getRhsUpdates
public static java.util.List<MergeOperation> getRhsUpdates(java.util.List<MergeOperation> mergeOperations)
- Parameters:
mergeOperations
- A set of merge operations.- Returns:
- A new list with all updates on the Right-Hand-Side branch.
-
getConflicts
public static java.util.List<MergeOperation> getConflicts(java.util.List<MergeOperation> mergeOperations)
- Parameters:
mergeOperations
- A set of merge operations.- Returns:
- A new list with all conflicts between the two branches.
-
getLhsBranch
protected static IlrBaseline getLhsBranch(java.util.List<MergeOperation> mergeOperations)
-
getRhsBranch
protected static IlrBaseline getRhsBranch(java.util.List<MergeOperation> mergeOperations)
-
fillDependencies
protected static void fillDependencies(IlrSession session, IlrBranch branch, java.util.Map<java.lang.String,IlrBranch> sortedDependencies) throws IlrApplicationException
- Throws:
IlrApplicationException
-
-