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:
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
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
Comments
Geoff Alexander
commented Mar 24 '20, 3:34 p.m.
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
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.