Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC Client Java API: How do I get the state of the user's version before the merge from an IChange merge state?

I have an IChange instance, change, which I obtained from an IChangeSet instance, changeset, via a call to changeSet.changes().  I use change.mergeStates() to get a list of the change's merge states.  From the IChange.mergeStates Javadoc:

Consider this list to be the proposed versions that were merged with the before state. The after state is the versionable after the merge has been completed. The state of the user's version (mine) before the merge is not recorded in this IChange. It can be found in the IChange of the previous IChangeSet state.

How do I get the IChange of the previous IChangeSet state?  I tried calling changeSet.getMergePredecessorState() to get the the previous IChangeSet state.  However, it always returns null.

0 votes


Accepted answer

Permanent link
I believe that getMergePredecessorState will always be null for SCM items.

You want IChangeSet.getPredecessorState() (defined on IAuditable),
To fetch that previous state you will need to use IItemManager.fetchCompleteState rather than just fetchCompleteItem.

Geoff Alexander selected this answer as the correct answer

0 votes

Comments

Thanks for the response.  It was a misunderstanding on my part.  I finally realized that IChangeSet.getPredecessorState() gives the history of a single change set.

Change sets can be reordered in history, and different workspaces/streams may have the same change sets in different orders.   So a given change set only captures transitions between file states, overall history is managed separately.


Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936
× 1,202
× 169

Question asked: Mar 18 '20, 3:16 p.m.

Question was seen: 1,456 times

Last updated: Apr 08 '20, 4:15 p.m.

Confirmation Cancel Confirm