It's all about the answers!

Ask a question

How to determine if a change set contains merges due to conflict

Amogh Gangadhar (111) | asked Jul 21 '21, 11:10 a.m.
edited Aug 04 '21, 5:11 a.m.

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

Be the first one to answer this question!

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.