How to determine if a change set contains merges due to conflict
I'm currently working on RTC eclipse API and I have a use case where I need to determine whether a change set was merged with a different change set after a conflict.
I need to determine the points pointed in this image.
What I'm currently doing is:
IChangeSetHandle csh;
IProgressMonitor monitor = new NullProgressMonitor();
IChangeSet changeSet = (IChangeSet) repository.itemManager().fetchCompleteItem(csh, IItemManager.DEFAULT, monitor);
ItemId<IItem> itemId = new ItemId<>(changeSet.getItemType(), changeSet.getItemId());
IChange change = ChangeSetUtil.getChangeFor(changeSet, itemId);
mergeState = ChangeSetUtil.getLastMergeState(change);
But the
change
object is always
null
.
What I would like to do is:
if (mergeState.isMergedDueToConflict()) // Check if a change contains merge
{
// Do something
}
basically do something if the change set contains merge due to conflict. I'm not sure what I'm doing wrong here.
Note: The RTC version that I'm using is 6.0.6.1