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.
Accepted answer
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.