|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.viewcomparemerge.ItemDifference
public final class ItemDifference
Represents the difference between a given item from the source view and the corresponding item in the target view.
Session.getDifferences()| Method Summary | |
|---|---|
MergeAction |
getAction()
Gets the action that will be performed at commit time to merge this difference from the source to the target. |
ItemDifference[] |
getAffectedDifferences(MergeAction newAction)
Determines which differences would be affected if the merge action for this difference were changed to the given one. |
MergeAction |
getDefaultAction()
Gets the default action recommended when merging this difference to the target view. |
java.lang.String |
getDescription()
Gets a user-friendly description of this difference. |
DifferenceType |
getDifferenceType()
Gets the difference type associated with this difference. |
MergeAction[] |
getLegalActions()
Gets the list of merge actions that are legal for this difference. |
java.io.File |
getMergedFileContent()
Gets the path to a file within this session's working vault where the merged file content for this difference resides. |
File |
getMergedFileContentItem()
Gets the StarTeam file revision whose content was used as the merged file content for this difference, or null if the merged content was not set via setMergedFileContentItem. |
Item |
getMergedItem()
Gets an item that closely approximates the state the target item after the merge, if the session were to be committed in its current state. |
Session |
getSession()
Gets the VCM session to which this difference belongs. |
Item |
getSourceAncestor()
Gets the item from the source item's history that was used to determine whether the source item has changed or moved since the last merge operation. |
Item |
getSourceItem()
Gets the source item associated with this difference. |
Item |
getSourceItemForCompare()
Gets the source item associated with this difference May be null for some difference types (for example, "New in Target"). |
Item |
getTargetAncestor()
Gets the item from the target item's history that was used to determine whether the target item has changed or moved since the last merge operation. |
Item |
getTargetItem()
Gets the target item associated with this difference. |
Item |
getTargetItemForCompare()
Gets the target item associated with this difference May be null for some difference types (for example, "New in source"). |
Item.Type |
getType()
Gets the item type of the source and target items in this difference. |
boolean |
isCommitted()
Determines whether or not this difference has been commited. |
boolean |
isConflictDetected()
Determines whether or not this difference represents a merge conflict. |
boolean |
isFileCheckin()
Determines whether or not applying the current action at commit time would result in a file checkin. |
boolean |
isFileMerge()
Determines whether or not this difference represents a file whose content has changed in both the source and target in such a way as to create a merge condition. |
boolean |
isLegalAction(MergeAction action)
Determines whether or not the given action is a legal action for this item difference. |
boolean |
isNonTipReverseShare()
Determines whether or not committing this difference resulted in a reverse share from a non-tip revision. |
boolean |
isPropertyMerge()
Determines whether or not there is at least one property whose value has changed in both the source item and target item in such a way as to create a merge condition. |
boolean |
isPropertyMergeFor(Property property)
Determines whether or not the given property has changed in both the source item and target item in such a way as to create a merge condition. |
boolean |
isUnresolved()
Determines whether or not this difference has an unresolved merge condition. |
boolean |
isUnresolvedFileMerge()
Determines whether or not this difference represents a file whose content has changed in both the source and target in such a way as to create a merge condition, and that merge condition has not yet been resolved. |
boolean |
isUnresolvedPropertyMerge()
Determines whether or not there is at least one property whose value has changed in both the source item and target item in such a way as to create a merge condition, and that merge condition has not yet been resolved. |
boolean |
isUnresolvedPropertyMergeFor(Property property)
Determines whether or not the given property has changed in both the source item and target item in such a way as to create a merge condition, and that merge condition has not yet been resolved. |
void |
setAction(MergeAction newAction)
Sets the action that will be performed at commit time to merge this difference from the source to the target. |
void |
setMergedFileContent(java.io.File mergeResult)
Sets the merged file content for this difference. |
void |
setMergedFileContentItem(File starTeamFile)
Similar to setMergedFileContent, except
that the merged file content is taken from the given StarTeam file
revision. |
java.lang.Object |
setMergedPropertyValue(Property property,
java.lang.Object value)
Sets the value of the specified property on the merged item. |
java.lang.String |
toString()
Gets a string representation of this difference. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public Item.Type getType()
public Item getMergedItem()
The same merged item also appears in the merge preview.
Session.getMergePreview()public Session getSession()
public java.lang.String getDescription()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isLegalAction(MergeAction action)
action - The MergeAction to be tested.
DifferenceType.isLegalAction(MergeAction),
ItemDifference.getLegalActions()public MergeAction getDefaultAction()
The action associated with a given difference may be overridden, and therefore may differ from the default action.
ItemDifference.setAction(com.starteam.viewcomparemerge.MergeAction),
ItemDifference.isLegalAction(MergeAction)public MergeAction[] getLegalActions()
ItemDifference.setAction(com.starteam.viewcomparemerge.MergeAction),
DifferenceType.getLegalActions(),
ItemDifference.isLegalAction(MergeAction)public ItemDifference[] getAffectedDifferences(MergeAction newAction)
For example, consider a folder that is "New in source". Changing the action from reverse share to ignore would also affect the differences for any "New in source" files in that folder. (If the folder isn't shared, its children won't be either.)
This method does not actually change the actions of any differences; the
changes would not occur unless setAction were called.
newAction - the action to test against
ItemDifference.setAction(com.starteam.viewcomparemerge.MergeAction),
ItemDifference.getLegalActions()public MergeAction getAction()
ItemDifference.setAction(com.starteam.viewcomparemerge.MergeAction),
ItemDifference.getDefaultAction()public void setAction(MergeAction newAction)
The new action overrides the default. It must be one of the actions that is legal for this difference.
newAction - The action that will be performed at commit time.ItemDifference.getAction(),
ItemDifference.getLegalActions(),
ItemDifference.getDefaultAction()public boolean isConflictDetected()
ItemDifference.isPropertyMerge(),
ItemDifference.isFileMerge(),
ItemDifference.isUnresolved()public boolean isFileMerge()
ItemDifference.isUnresolvedFileMerge()public boolean isFileCheckin()
public boolean isUnresolvedFileMerge()
ItemDifference.isFileMerge()public boolean isNonTipReverseShare()
When the source item being reverse shared is not the tip revision of the item, StarTeam compensates by:
reverse sharing the tip revision;
creating a new revision in the target view that has the effect of rolling back the item properties and/or file content to the desired non-tip revision;
forcing the item to branch in the source view, so that a subsequent rebase will cause a merge condition.
This isNonTipReverseShare flag is set at commit time, and is always false prior to the commit.
MergeAction.REVERSE_SHARE,
Item.reverseShareTo(Folder)public java.io.File getMergedFileContent()
The difference must be a file difference with a file merge condition that has already been resolved.
ItemDifference.isFileMerge(),
ItemDifference.isUnresolvedFileMerge(),
ItemDifference.setMergedFileContent(java.io.File)public void setMergedFileContent(java.io.File mergeResult)
The difference must be one with a file merge condition. The provided file content is copied into the session's working vault, and the file merge condition is marked resolved.
An alternate way to specify the merged file content for a difference is to check in the new content through the merge preview. For example:
// The merged item is accessible through the ItemDifference // and through the merge preview; they are physically the same. Item item = diff.getMergedItem(); // Checking in a new file revision also resolves the conflict. View preview = session.getMergePreview(); CheckinManager mgr = preview.createCheckinManager(); mgr.checkin((File) item, path);
mergeResult - The merged file content for this difference.ItemDifference.isFileMerge(),
ItemDifference.getMergedFileContent(),
Session.getMergePreview(),
ItemDifference.setMergedFileContentItem(com.starteam.File)public void setMergedFileContentItem(File starTeamFile)
setMergedFileContent, except
that the merged file content is taken from the given StarTeam file
revision.
starTeamFile - StarTeam file revision whose content is used as the merged
file content for this difference.ItemDifference.setMergedFileContent(java.io.File),
ItemDifference.isFileMerge(),
ItemDifference.getMergedFileContentItem()public File getMergedFileContentItem()
setMergedFileContentItem.
ItemDifference.setMergedFileContentItem(com.starteam.File)
public java.lang.Object setMergedPropertyValue(Property property,
java.lang.Object value)
Setting the property value resolves any outstanding merge conflict associated with this property.
Alternatively, an application can change the property value using the
normal setValue and
update methods available on the
merged item.
property - The property whose value is to be changed.value - The new property value.
ItemDifference.isPropertyMerge(),
ItemDifference.isPropertyMergeFor(Property),
ItemDifference.getMergedItem(),
TypedResource.setValue(Property,Object),
ViewMember.update()public Item getSourceItem()
ItemDifference.getTargetItem(),
ItemDifference.getMergedItem()public Item getSourceItemForCompare()
ItemDifference.getSourceItem()public Item getSourceAncestor()
Options.getIgnoreMergePoints()public Item getTargetItem()
ItemDifference.getSourceItem(),
ItemDifference.getMergedItem()public Item getTargetItemForCompare()
ItemDifference.getTargetItem()public Item getTargetAncestor()
Options.getIgnoreMergePoints()public boolean isUnresolved()
ItemDifference.isConflictDetected(),
ItemDifference.isUnresolvedFileMerge(),
ItemDifference.isUnresolvedPropertyMerge(),
ItemDifference.isUnresolvedPropertyMergeFor(Property)public boolean isPropertyMerge()
ItemDifference.isUnresolvedPropertyMerge(),
ItemDifference.isPropertyMergeFor(Property),
ItemDifference.setMergedPropertyValue(com.starteam.Property, java.lang.Object)public boolean isUnresolvedPropertyMerge()
ItemDifference.isPropertyMerge(),
ItemDifference.isUnresolvedPropertyMergeFor(Property),
ItemDifference.setMergedPropertyValue(com.starteam.Property, java.lang.Object)public boolean isPropertyMergeFor(Property property)
property - An item property.
ItemDifference.isPropertyMerge(),
ItemDifference.isUnresolvedPropertyMergeFor(Property),
ItemDifference.setMergedPropertyValue(com.starteam.Property, java.lang.Object)public boolean isUnresolvedPropertyMergeFor(Property property)
property - An item property.
ItemDifference.isUnresolvedPropertyMerge(),
ItemDifference.isPropertyMergeFor(Property),
ItemDifference.setMergedPropertyValue(com.starteam.Property, java.lang.Object)public boolean isCommitted()
Note that if the session was committed as an atomic transaction, then all differences are committed together. However, on a server that does not support atomic transactions, the session may be partially committed. In this case, some differences may report that they have been committed, while others may not.
public DifferenceType getDifferenceType()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||